Jump to content

Form Fields


ltoto

Recommended Posts

i have fotton basically how to do the thing in forms when you must fill in certain feilds of the form before you can sumbit it.

So here is a form for example:

[code]<form name="flights" method="POST" action="<?php echo $editFormAction; ?>">
  <h2>Flights Enquiry Form</h2>
  <br>
  <label for="selectTitle">Title:</label>
  <select name="selectTitle" id="selectTitle">
    <option selected value="Mr">Mr</option>
    <option value="Mrs">Mrs</option>
    <option value="Ms">Ms</option>
    <option value="Miss">Miss</option>
  </select>
  <br>
  <label for="txtInitial">Initial:</label>
  <input name="txtInitial" type="text" id="txtInitial" size="5">
  <br>
  <label for="txtSurname">Surname:</label>
  <input name="txtSurname" type="text" id="txtSurname">
  <br>
  <label for="txtDept"> Dept Airport:</label>
  <input name="txtDept" type="text" id="txtEmail" size="25">
  <br>
  <label for="txtDest">Destination Airport:</label>
  <input name="txtDest" type="text" id="txtEmail" size="25">
  <br>
  <label for="selectDuration">Duration: </label>
  <select name="selectDuration" id="selectDuration">
    <option>3 days</option>
    <option>1 week</option>
    <option>2 weeks</option>
    <option>more then 2 weeks</option>
  </select>
  <br>
  <label for="selectAdult">Adults(13+)</label>
  <select name="selectAdult" id="selectAdult">
    <option selected>0</option>
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
    <option>5</option>
    <option>6</option>
    <option>7</option>
    <option>8</option>
    <option>9</option>
    <option>10</option>
    <option>more than 10</option>
  </select>
  <br>
  <label for="selectChild">Children up to 12: </label>
  <select name="selectChild" id="selectChild">
    <option>0</option>
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
    <option>5</option>
    <option>6</option>
    <option>7</option>
    <option>8</option>
    <option>9</option>
    <option>10</option>
    <option>more than 10</option>
  </select>
  <br>
  <label for="selectInfant"> Infant up to 2 years: </label>
  <select name="selectInfant" id="selectInfant">
    <option>0</option>
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
    <option>5</option>
    <option>6</option>
    <option>7</option>
    <option>8</option>
    <option>9</option>
    <option>10</option>
    <option>more than 10</option>
  </select>
  <br>
  <label for="selectPrebook">Pre Book Seats: </label>
  <select name="selectPrebook" id="selectInfant">
    <option>Yes</option>
    <option>No</option>
  </select>
  <br>
  <label for="selectLeg">Extra Leg Room Seats if Applicable: </label>
  <select name="selectLeg" id="selectLeg">
    <option>Not Required</option>
    <option>Required</option>
  </select>
  <br>
  <label for="selectMeals"> Meals Required: </label>
  <select name="selectMeals" id="selectMeals">
    <option>Not Required</option>
    <option>Required</option>
  </select>
  <br>
  <label for="selectParking"> Airport Car Parking: </label>
  <select name="selectParking" id="selectParking">
    <option>On Airport</option>
    <option>Off Airport</option>
  </select>
  <br>
  <label for="selectVip"> VIP Lounge at Airport: </label>
  <select name="selectVip" id="selectVip">
    <option>Not Required</option>
    <option>Required</option>
  </select>
  <br>
  <br>
  <label for="txtExtras">Medical Requirements::</label>
  <textarea name="txtExtras" cols="30" rows="5" id="txtExtras"></textarea>
  <br>
  <br>
  <label for="txtExtras">Other Requirements:</label>
  <textarea name="txtMedical" cols="30" rows="5" id="txtMedical"></textarea>
  <br>
  <input type="submit" name="Submit" value="Submit" class="btn">
  <input type="hidden" name="MM_insert" value="flights">
</form>
[/code]

any suggestions, it annoying me because i used to know how to do it....
Link to comment
Share on other sites

He probably means how to validate with dreamweaver because

<input type="hidden" name="MM_insert" value="flights">
The MM before something means Macro Media, You can tell one from a mile away by the big MM before it.  This is probably a form created by dreamweaver, I don't know how to validate using dreamweaver, you can just program it yourself like
[code]<?php
$errorhandler = "";
if ($variable == "") {
$errorhandler .= "The variable name was left blank please fix this.<br />";
}
if ($variable2 == "")
$errorhandler .= "The variable2 name was left blank please fix this.<br />";
}
if ($errorhandler != "") {
echo "<div style=\"color:red;\">";
echo $errorhandler;
echo "</div>";
}
?>[/code]
this is something basic you can just build onto it from there, if you need more help ask.
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.