PC Review Forums Newsgroups Microsoft Word Microsoft Frontpage Required Fields - Please Help

Reply

Required Fields - Please Help

 
Thread Tools Rate Thread
Old 27-07-2006, 04:53 PM   #1
=?Utf-8?B?TmlraGls?=
Guest
 
Posts: n/a
Default Required Fields - Please Help


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>

  Reply With Quote
Old 27-07-2006, 08:23 PM   #2
Paul C
Guest
 
Posts: n/a
Default Re: Required Fields - Please Help

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> </b> 
<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

"Nikhil" <Nikhil@discussions.microsoft.com> wrote in message
news:A36F1FD9-6510-4F3D-8280-EB248A83D7B1@microsoft.com...
>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>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off