From: ghfftttyyudsderycv76 on
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.getEleme
ntById('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>


From: Azadi on
you don't know how to do a) or b)?

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
From: ghfftttyyudsderycv76 on

how would you finish a) then move on to b) per requirement listed ? thks.
From: Azadi on
1) optional: do js data validation for user-friendliness/cancel form
submit if errors;
2) validate form data on server & return to form if errors;
3) if you need form's data in next step - duplicate form into a session
var;
4) cflocate to next step.

how about that?

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
From: ghfftttyyudsderycv76 on
Role: no server side validation for this particular requirement. Hence, 2) is not applicable.

3) & 4) not really relevant per requirement
 |  Next  |  Last
Pages: 1 2
Prev: ColdFusion 8 CFMENU Issue
Next: cfthread