Re: [PHP] Problem with Javascript:...submit()
Stephen Leaf wrote: On Thursday 13 October 2005 01:13 am, Johan Grobler wrote: while ($row = mysql_fetch_array($sql_result)) { echo" ".$row['LITERATURE_title']." - ".$row['res_fname']." ".$row['res_lname']." ... 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. Another way you can access these is by using this function. Stephen is being polite - he means the 'correct' way ;-) document.getElementByName('name'); or document.getElementById('id'); As I recall w3 sees ByName as standard but Mozilla(and many others) only support ById, the last time I checked. Any ways around this? thanx Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Peninsula University of Technology or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Javascript:...submit()
On Thursday 13 October 2005 01:13 am, Johan Grobler wrote: > while ($row = mysql_fetch_array($sql_result)) > { > echo" method=\"post\"> > >".$row['LITERATURE_title']." - ".$row['res_fname']." > ".$row['res_lname']." ... > > 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. Another way you can access these is by using this function. document.getElementByName('name'); or document.getElementById('id'); As I recall w3 sees ByName as standard but Mozilla(and many others) only support ById, the last time I checked. > > Any ways around this? > > thanx > > Disclaimer > This e-mail transmission contains confidential information, > which is the property of the sender. > The information in this e-mail or attachments thereto is > intended for the attention and use only of the addressee. > Should you have received this e-mail in error, please delete > and destroy it and any attachments thereto immediately. > Under no circumstances will the Cape Peninsula University of > Technology or the sender of this e-mail be liable to any party for > any direct, indirect, special or other consequential damages for any > use of this e-mail. > For the detailed e-mail disclaimer please refer to > http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Javascript:...submit()
I'm just taking a wild guess... but I'm guessing that if you set a name with spaces, it'll be replaced with "_"(underscore). A couple of ways around this is to 1) figure out a way to assign a one-word name for all your books(e.g. Code, ID number, etc.) 2) generate a hash code(e.g. md5($row['LITERATURE_title'])) will generate a one word(no spaces). If this is going to be a library application, you can always use "ISBNX"(no spaces, no dashes), since the idea is that every book has a unique ISBN number Johan Grobler wrote: while ($row = mysql_fetch_array($sql_result)) { echo" ".$row['LITERATURE_title']." - ".$row['res_fname']." ".$row['res_lname']." ... 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. Any ways around this? thanx Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Peninsula University of Technology or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Javascript:...submit()
Johan Grobler wrote: while ($row = mysql_fetch_array($sql_result)) { echo" ".$row['LITERATURE_title']." - ".$row['res_fname']." ".$row['res_lname']." ... 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
[PHP] Problem with Javascript:...submit()
while ($row = mysql_fetch_array($sql_result)) { echo" ".$row['LITERATURE_title']." - ".$row['res_fname']." ".$row['res_lname']." ... 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. Any ways around this? thanx Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Peninsula University of Technology or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php