Re: Problem with Javascript:...submit()
| From: | Jasper Bryant-Greene | Date: | Thu, 13 Oct 2005 06:26:44 +0000 |
| Subject: | Re: Problem with Javascript:...submit() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-224016@lists.php.net to get a copy of this message | ||
Johan Grobler wrote:
while ($row = mysql_fetch_array($sql_result)) { echo"<Form name=\"".$row['LITERATURE_title']."\" action=\"searchlit.php\" method=\"post\"> <font face=\"arial\" size=\"2\"> <a href=\"javascript:".$row['LITERATURE_title'].".submit();\" ".$row['LITERATURE_title']." - ".$row['res_fname']." ".$row['res_lname']."</a> ... Everything works as long as $row['LITERATURE_title'] is one word, see this variable contains the names of books, and if the books name is "Heaven" for instance it works fine but as soon as the title is something like "PHP for Dummies" it doesnt work and i get a error on page message, I tried using numbers as the form name but then the same thing happens.If you've got a row ID number or something, just call the form "lit[id]" (replacing [id] with the ID number), because I don't think a form name can start with a number. Otherwise you could sha1() the title and use that as the identifier, or simply remove all spaces... -- Jasper Bryant-Greene Freelance web developer http://jasper.bryant-greene.name/