powerlock2005
Technical User
All,
I have the following code for required fields and it works fine:
<script language="javascript" type="text/javascript">
<!-- hide from older browsers -->
function validForm(Form) {
if (Form.arrivalDate.value =="")
{
alert("Please enter your arrival date.")
Form.arrivalDate.focus()
return false
}
if (Form.departureDate.value =="")
{
alert("Please enter your departure date.")
Form.departureDate.focus()
return false
}
return true
}
// end hiding script -->
//-->
</script>
I need to add some if then statements for the above and I don't know how to do it using javascripts. I know it for visual basic, but not javascripts.
This is what I need to do:
I have a field called: hotel, which is a value list of Yes or No. I have 2 date fields, which are in the script above called: arrivalDate and departureDate.
If the value of hotel is Yes, then I want arrivalDate and departureDate to be required, but if the value of hotel is No, then arrivalDate and departureDate doesn't have to be required.
How do I do this?
Please help and thanks in advance.
I have the following code for required fields and it works fine:
<script language="javascript" type="text/javascript">
<!-- hide from older browsers -->
function validForm(Form) {
if (Form.arrivalDate.value =="")
{
alert("Please enter your arrival date.")
Form.arrivalDate.focus()
return false
}
if (Form.departureDate.value =="")
{
alert("Please enter your departure date.")
Form.departureDate.focus()
return false
}
return true
}
// end hiding script -->
//-->
</script>
I need to add some if then statements for the above and I don't know how to do it using javascripts. I know it for visual basic, but not javascripts.
This is what I need to do:
I have a field called: hotel, which is a value list of Yes or No. I have 2 date fields, which are in the script above called: arrivalDate and departureDate.
If the value of hotel is Yes, then I want arrivalDate and departureDate to be required, but if the value of hotel is No, then arrivalDate and departureDate doesn't have to be required.
How do I do this?
Please help and thanks in advance.