Jump to content

field set error


droidus

Recommended Posts

on a resigtration form, if there are errors on the form when it is submitted, it comes back, and asks you to fill in all the fields where there was an error.  i am having trouble with a radio group, texta area, and drop down box.  when the form is submitted with content in it, it should save it.  but it comes back empty.  for the last one (radio group) i wasn't sure how to do it...

 

here is my code:

 

<select name="state" value="<? if (isset($error)) { echo htmlentities($_POST['state']); } ?>
      <? if(isset($_SESSION['VBSRegistration2011state'])){  echo ($_SESSION['VBSRegistration2011state']); } ?>" />


<textarea name="medical" id="medical" cols="30" rows="10"
  value = "<? if (isset($error)) { echo htmlentities($_POST['medical']); }  ?>" placeholder = "Medical/other information we need to know. (Please include food allergies)" />



<input type="radio" name="photographypermission" value="agree" id="photographypermission" />
                I agree
<br />
                <input type="radio" name="photographypermission" value="disagree" id="photographypermission" />
                I Disagree

Link to comment
Share on other sites

text areas have the following format:

 

<textarea name="bla bla bla"> your text here </textarea>

 

radio groups have this format:

 

<input type="radio" name="bla bla bla" value="whatever" id="something" checked="checked" />

 

and dropdowns have this format:

 

<select name="">

  <option value="somevalue">Your Text Here</option>

  <option value="anothervalue" selected>Your Text Here</option>

</select>

 

the parts in bold are where you need to place your conditions and variables.

 

hope this helps.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.