Required Fields - Please Help

N

Nikhil

I have a simple question i hope,

I have a drop down with the value's "A" and "B"

If i selected any values from my drop down other than "B" i want the "name"
and "address" fields to be required by the user, however, if i select "B"
these fields are not required.

Please Help!!

I had a script like this going, but i know i am off:

<SCRIPT language = "javaScript">
if (deal_type = "B")
<!--webbot bot="Validation" b-value-required="FALSE" --><select size="1"
name="Name" style="background-color: #faebd7" tabindex="11"> and <!--webbot
bot="Validation" b-value-required="FALSE" --><select size="1" name="Address"
style="background-color: #faebd7" tabindex="11">
else
<!--webbot bot="Validation" b-value-required="TRUE" --><select size="1"
name="Name" style="background-color: #00FFFF" tabindex="11"> and <!--webbot
bot="Validation" b-value-required="TRUE" --><select size="1" name="Address"
style="background-color: #00FFFF" tabindex="11">;
</SCRIPT>
 
P

Paul C

Hi Nikhil
The simplest way would be to have a page with a form which has validation
rules and a page with a form with no validation rules.
If the person selects selects A then they are directed to the validation
form page or B they could be directed to the non validation form page.

Put this code in the head of the page, it redirects as soon as the drop down
is selected


<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>

and put this in the body where you want the form to go

<form name="form1" id="form1" method="post" action="">
<div align="right">
<b><font color="#2691A2">Search by
category</font>&nbsp;</b>&nbsp;
<select name="menu1" onchange="MM_jumpMenu('parent',this,0)"
size="1" id="imageblock">
<option>select your choice...</option>
<option value="http://www.google.co.uk/">google</option>
<option value="http://www.google.co.uk/">googlle</option>
</select>
</div>
</form>

Paul M
here is an example of the form
http://www.paulcmilner.co.uk/Gallery.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top