| | |
HTML Post problem
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Apr 2006
Posts: 20
Reputation:
Solved Threads: 0
Not sure where to put this as it contains HTML, Javascript and PHP and I can't figure out which one is the problem but because the problem is with an empty POST request I put it here, sorry if that is wrong.
Basically what it is doing is when the user clicks on a element that activates the javascript stop function it sets the value of number to the input fields value (which is set as readonly so the user can not change it.) This part works as the input field shows the value once the function has been executed yet upon submitting the value of $_POST['number'] is null, its empty.
I've looked over this again and again and I can't see what is wrong, the only two things I can think of are:
1) There is a typo/error that I keep overlooking
2) Something with the "readonly" field is affecting the form submit.
Can someone point me in the right direction and explain where I am going wrong.
HTML and CSS Syntax (Toggle Plain Text)
<form action="?do=submit" method="post"> <input id="number" readonly="readonly" style="width:7em;"/><br /> <input id="submit" type="submit" style="width: 6em;" value="Generating..." disabled="true"/> </form> <script type="text/javascript"> function stop() { var no = document.getElementById("number"); no.value = number; } </script> <?PHP if ($do == "submit"){ $number = $_POST['number']; echo $number . " successfully submitted."; } ?>
Basically what it is doing is when the user clicks on a element that activates the javascript stop function it sets the value of number to the input fields value (which is set as readonly so the user can not change it.) This part works as the input field shows the value once the function has been executed yet upon submitting the value of $_POST['number'] is null, its empty.
I've looked over this again and again and I can't see what is wrong, the only two things I can think of are:
1) There is a typo/error that I keep overlooking
2) Something with the "readonly" field is affecting the form submit.
Can someone point me in the right direction and explain where I am going wrong.
![]() |
Similar Threads
- reading txt file then sending to function (C)
- O/T. HTML printing problem.......... (HTML and CSS)
- XP File Problem (Windows NT / 2000 / XP)
- start up programs problem (Windows NT / 2000 / XP)
- friends problem, HJT log (Viruses, Spyware and other Nasties)
- problem with icon (Windows NT / 2000 / XP)
- not sure where to post a trojan/virus problem (Windows NT / 2000 / XP)
- homepage set to res://jlxzg.dll/index.html#96676 (Viruses, Spyware and other Nasties)
Other Threads in the HTML and CSS Forum
- Previous Thread: CSS Version of this Javascript menu
- Next Thread: Rounded Corners Dropdown
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7





