Requirement:
a) do data validation for form 1; // ignore data capture
b) move on to form 2
Env:
cf8
Code:
<code>
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<title>Multiple Forms and Data Validation</title>
</head>
<body>
<h1>Multiple Forms and Data Validation</h1>
<cfform id="step1" name="ContactData" method="POST"
preserveData="yes">
<Table cellpadding=0 cellspacing=0 width="85%" border=0
align="center">
<tr>
<td colspan="2">Name: <cfinput type="text"
name="fullName"></td>
</tr>
<tr>
<td colspan="2">Email: <cfinput type="text"
name="email" required="yes" message="Email is
required"></td>
</tr>
<tr>
<td colspan="2" height="5"></td>
</tr>
<tr>
<td colspan="2">
<cfinput type="submit" name="step1Send" value="Submit the
Form and Proceed to Step 2"
onclick="document.getElementById('step1').style.display='none';document.getElementById('step2').style.display='block';">
</td></tr>
</Table>
</cfform>
<cfform id="step2" name="PaymentData" method="POST"
style="display:none">
<Table cellpadding=0 cellspacing=0 width="85%" border=0
align="center">
<tr><td colspan="2">
Card type:<cfselect name="cc">
<option>Visa
<option>Master
<option>American Express
</cfselect>
Card number:<cfinput name="ccNum" validate="creditcard"
required="yes" message="A valid credit card number is required"
>
Holder:<cfinput type="text" name="ccName" message="Card
holder is required" required="yes">
</td></tr>
<tr>
<td colspan="2" height="5"></td>
</tr>
<tr>
<td colspan="2">
<cfinput type="submit" name="step2Send" value="Submit the
Form and Complete the Process" onclick="alert('hey you');">
</td></tr>
</Table>
</cfform>
</body>
</html>
</code>