Re: Problem with Javascript:...submit()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux