Conditional Validation

C

Crystal

Ok, I have a select box with different methods of payment (bill
account, telecheck, credit card, ect) If Credit Card is selected, I
need to be able to require a valid credit card number based on the
card type selected... Any clues?

This is what I have so far:

if (theForm.selMethod.selectedIndex.value == "2")
{
if (theForm.txtCCNumber.value.length < 10)
{
alert('A Valid Credit Card Number is required for the payment method
you have selected.')
theForm.txtCCNumber.focus()
return (false);
}
return(false);

<select name="selMethod">
<option value="1" <%Call RequestInfo("selMethod","1")%>>Bill
Account</option>
<option value="2" <%Call RequestInfo("selMethod","2")%>>Credit
Card</option>
<option value="3" <%Call RequestInfo("selMethod","3")%>>Certified
Funds</option>
<option value="4" <%Call
RequestInfo("selMethod","4")%>>Telecheck</option>
</select>

<select name="selCard">
<option value="1" <%Call RequestInfo("selCard","1")%>>Visa</option>
<option value="2" <%Call RequestInfo("selCard","2")%>>Amex</option>
<option value="3" <%Call
RequestInfo("selCard","3")%>>Mastercard</option>
<option value="4" <%Call
RequestInfo("selCard","4")%>>Discover</option>
</select>

basically...

Any ideas?
 

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

Members online

Forum statistics

Threads
474,077
Messages
2,570,566
Members
47,202
Latest member
misc.

Latest Threads

Top