[thelist] help with JS error

Jeffrey Barke jeffrey.barke at themechanism.com
Thu Jun 14 15:22:07 CDT 2007


You're not wrapping your row IDs in quotes for the FuncShowHide call.

For instance, one of them reads FuncShowHide(ED4), when it should  
read FuncShowHide('ED4')

Jeffrey

--
Cheers.
Jeffrey Barke
jeffery.barke at theMechanism.com
Lead Developer, US
theMechanism - New York City
440 9th Avenue, 8th Floor
New York, NY 10001-1631
t: +1 212.404.3150
c: +1 917.941.1232
f: +1 212.404.3228



http://www.theMechanism.com

Subscribe to theMechcast, our monthly Podcast:
http://feeds.feedburner.com/theMechcast

theMechanism - London
3rd Floor
405 The Strand
London E14 9FW
United Kingdom
t: +44 (0)20 7240 4942
f: +44 (0)20 7240 2262

--
The information contained in this Electronic mail message is attorney  
privileged and confidential information intended only for the use of  
the individual or entity named above. Such information also is  
intended to be privileged, confidential, and exempt from disclosure  
under applicable law. If the reader of this message is not the  
intended recipient or the employee or agent responsible to deliver it  
to the intended recipient, you are hereby notified that any  
dissemination, distribution, or copying of this communication is  
strictly prohibited. If you have received this communication in  
error, please notify us immediately by telephone.

Blah, blah, blah...
--


On Jun 14, 2007, at 3:28 PM, Bruce Gilbert wrote:

> Hello,
>
> I am trying to show/hide a table row extracting from a MySQL  
> database using
> a unique ID. I have the PHP/MySQL part working correctly, but I get an
> undefined..JS error, so something is amiss...the page in Question is
> http://www.carrentalsupport.com/bruce/Query.php, and if you click  
> on 'more
> info. you will get the error. What is supposed to happen is a row is
> supposed to appear and dissapear.
>
> My PHP is :
>
>
> //row for each record
>      while ($row = mysql_fetch_array($rs))
>
>       {
>                  echo"<tr id='". $row[0] . "'><td>
>     $img
> </td><td> $row[6] </td><td> $row[0]</td><td> $row[1] </td><td  
> id='header'><a
> href='#' onClick='FuncShowHide(" . $row[0] . ")'> More Info.</a></ 
> td><td
> id='header'><a class='WHATSTHIS' onclick='selectLoc([0])'
> href='javascript:;'>Select this Location</a></td></tr>";
>                  echo"<tr id='hideShow'
> style='display:none'><td><strong>Address:</strong> $row[3]
> </td><td><strong>Address:</strong>$row[4] </td><td><strong>City:</ 
> strong>
> $row[5] </td><td> $row[6]</td><td>$row[7] </td><td><strong>Phone:</ 
> strong>
> $row[2] </td></tr>";
>      }
>
>      echo "</table>";
> and in the JS I have:
>
> <script language="javascript" type="text/javascript">
>       function FuncShowHide(row){
>
>       if (document.getElementById('hideShow').style.display ==
> document.getElementById(row).style.display){
>          document.getElementById('hideShow').style.display = "none";
>       } else {
>          document.getElementById('hideShow').style.display =
> document.getElementById(row).style.display;
>       }
>    }
> </script>
>
> -- 
> ::Bruce::
> -- 
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !




More information about the thelist mailing list