abhishekdeveloper Posted February 28, 2012 Share Posted February 28, 2012 Dear All, I am developing a website www.computationalphotography.in on which I need to register new users. I have designed an HTML form for this purpose, but will need help with writing the code for checking and validating the data in the respective fields. The code for my web form is below and the address of the website is www.computationalphotography.in/registration.php: <html> <head> <title> Photography Experiment Registration </title> </head> <body> <h1> Questionnaire </h1> <h3> We would like to know about your background and interests in photography. For each multiple-choice question, please circle all answers that apply.</h3> <form method="post" action="registration.php"> Name <input name="name" type="text"> <br> <br> Email <input name="email" type="text"> <br> <br> 1.) Roughly How many pictures do you take each year? <br> <br> <input name="radios" type="radio" value="a"> a) a few: <10 in a year <br> <input name="radios" type="radio" value="b"> b) many: probably 100's a photos a year <br> <input name="radios" type="radio" value="c"> c) a lot: probably 1000's of photos a year <br> <br> 2.) Do you share your pictures with anyone? <br> <input name="radios" type="radio" value="a"> a) No <br> <input name="radios" type="radio" value="b"> b) Yes, but only with friends or family <br> <input name="radios" type="radio" value="c"> c) Yes, I share with friends or family and also post on public sites such as Flickr, Picasaweb, or Snapfish for anyone to see. <br> <input name="radios" type="radio" value="d"> d) Yes, I share frequently and I have also published my photos in books or magazines, or exhibitde my photos in shows. <br> <br> 3.) How much training in photography have you had? <br> <input name="radios" type="radio" value="a"> a) None <br> <input name="radios" type="radio" value="b"> b) Some, but it's self-taught from books or websites <br> <input name="radios" type="radio" value="c"> c) Quite a bit: I have taken courses in photography <br> <input name="radios" type="radio" value="d"> d) A lot:I have completed a degreee or certificate in the subject <br> <br> 4.) How do you describe yourself as a photographer? <br> <input name="radios" type="radio" value="a"> a) A novice:someone who takes a few pictures occasionally <br> <input name="radios" type="radio" value="b"> b) An amateur:someone who takes many photos, but doesn't usually share them <br> <input name="radios" type="radio" value="c"> c) An enthusiast:someone who loves to take pictures, possibly shows them with oters on public sites, or who might own a DSLR, or frequently uses a camera in other than "automatic mode" <br> <input name="radios" type="radio" value="d"> d) An expert:skilled photographer who has published their work, or exhibited their work in shows, or has been paid for their work <br> <br> 5.) Do you have artistic training or exposure? <br> <input name="radios" type="radio" value="a"> a) No <br> <input name="radios" type="radio" value="b"> b) I visit museums or art galleries <br> c) I have studied art: please describe <br> <textarea name="data5c" cols="50" rows="5"> </textarea> <br> d) I am a practicing artist: please describe <br> <textarea name="data5d" cols="50" rows="5"> </textarea> <br> <br> 6.) Some optional information, if you don't mind. We respect your privacy. <br> <br> Age <br> <textarea name="6a" cols="1" rows="1"> </textarea> <br> <br> Gender <br> <input name="radios" type="radio" value="a"> a) Male <br> <input name="radios" type="radio" value="b"> b) Female <br> <br> Languages Spoken <br> <textarea name="6b" cols="25" rows="2"> </textarea> <br> <br> Languages Read <br> <textarea name="6c" cols="25" rows="2"> </textarea> <br> <br> <br> <input type="submit" value="Send"> <input type="reset" value"Reset"> </form> </body> </html> Kindly help me out with this issue. Thank you for your help in this regard. Quote Link to comment https://forums.phpfreaks.com/topic/257916-need-help-with-data-entry-code/ Share on other sites More sharing options...
trq Posted February 28, 2012 Share Posted February 28, 2012 Where exactly are you stuck? Quote Link to comment https://forums.phpfreaks.com/topic/257916-need-help-with-data-entry-code/#findComment-1321977 Share on other sites More sharing options...
abhishekdeveloper Posted February 28, 2012 Author Share Posted February 28, 2012 I need to check whether data in each and every field is entered in the proper format and send an error message if anything is left out or entered in the wrong format. Where exactly are you stuck? Quote Link to comment https://forums.phpfreaks.com/topic/257916-need-help-with-data-entry-code/#findComment-1321979 Share on other sites More sharing options...
trq Posted February 28, 2012 Share Posted February 28, 2012 And, where exactly are you stuck? Quote Link to comment https://forums.phpfreaks.com/topic/257916-need-help-with-data-entry-code/#findComment-1321981 Share on other sites More sharing options...
abhishekdeveloper Posted February 28, 2012 Author Share Posted February 28, 2012 thanks for your prompt reply...let me get back to you in a short while... And, where exactly are you stuck? Quote Link to comment https://forums.phpfreaks.com/topic/257916-need-help-with-data-entry-code/#findComment-1321982 Share on other sites More sharing options...
batwimp Posted February 28, 2012 Share Posted February 28, 2012 Your radio buttons are set up wrong. You need to have a different name= for each answer set. Right now, each answer has the same name, so you can only select one radio button throughout the entire form. Quote Link to comment https://forums.phpfreaks.com/topic/257916-need-help-with-data-entry-code/#findComment-1322134 Share on other sites More sharing options...
abhishekdeveloper Posted February 28, 2012 Author Share Posted February 28, 2012 @batwimp...Thanks for pointing this out...this is one of the problems that I was facing currently with my code... Your radio buttons are set up wrong. You need to have a different name= for each answer set. Right now, each answer has the same name, so you can only select one radio button throughout the entire form. Quote Link to comment https://forums.phpfreaks.com/topic/257916-need-help-with-data-entry-code/#findComment-1322142 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.