The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
Can't obtain the form values - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Modules / Other (https://forums.formtools.org/forumdisplay.php?fid=8) +--- Forum: Form Validation: JS + PHP (https://forums.formtools.org/forumdisplay.php?fid=18) +--- Thread: Can't obtain the form values (/showthread.php?tid=1658) |
Can't obtain the form values - gammapulsar - Sep 25th, 2011 Hi everyone, I am coding up a survey and I need to record the option that the user will choose when they do the survey. All my questions have this form <form action="path/formtools/process.php" method="post"> <input type="radio" name="course" value="biochem" /> Biochemistry<br /> <input type="radio" name="course" value="bio" /> Biology<br /> <input type="radio" name="course" value="chem" /> Chemistry<br /> <input type="radio" name="course" value="math" /> Mathematics<br /> <input type="radio" name="course" value="phy" /> Physics<br /> <input type="radio" name="course" value="JMC" /> JMC </form> and the submit button has this form: <form action="path/formtools/process.php" method="post"> <input type="submit" value="Submit" /> <input type="hidden" name="form_tools_form_id" value="x" /> Am I missing something obvious? Basically when I go to the view option, to see who completed the survey I can't see the option they chose. I set up the Option lists so now if I enter a submission I can add the values myself but that's a bit useless. Can anyone please help me? This should be something quite straightforward but I can't seem to be able to find the answer. Thanks. RE: Can't obtain the form values - Ben - Sep 27th, 2011 Hi Gamma, That all looks pretty good. Your markup is totally fine. My first guess would be to check your Option List to make sure that the values and display values match the value="..." attributes and the labels in your form. Only the values are "biochem", "bio", "chem" etc. values are actually passed along in the forms. The display text value is just for show. Secondly, double-check the name attribute in your form matches the field name stored in Form Tools (i.e. "course"). To check, go to your Edit Form -> Fields tab and look at the "Field Name" column for that field. If none of that works, try this: 1. temporarily changing the field to a textbox, 2. Put through a submission what one of those values selected, 3. Log into Form Tools and look at the submission. You *should* see the value attribute of the item you selected. If you didn't, that means that the field wasn't passed along in the POST request. That usually means invalid markup (yours is fine), or maybe the field isn't inside the <form> </form> tags. Let me know how it goes! |