[ic] form validation revisited

DB interchange-users@icdevgroup.org
Mon Nov 25 09:03:01 2002


Your original post said "simplest possible" but this may be more simple 
than you want. I have a feedback form on my store which uses a very 
crude validation. Unlike the checkout form which tells you which fields 
are missing, this form just does not submit until all required fields 
are completed. Like you, I'd love to see a HOWTO that explains how to do 
the better feedback type validation.

But here's a demo form that does indeed validate. Be sure to clearly 
mark the required fields. I hope someone posts a better way!

DB

------- begin crude validating form ----------------
<center><font size="+1" color="#0099ff">
Feedback
</font></center>
[update values]
<form action="[process]" method=post>
<input type=hidden name=mv_session_id value="[data session id]">
<input type=hidden name=mv_doit value=return>
<input type=hidden name=mv_nextpage value=feedback2.html>
<INPUT TYPE=hidden NAME=mv_form_profile VALUE=Check_form>

First Name:
<INPUT MAXLENGTH=30 NAME=fname type=text size=15 value="[value fname]"><br>

Last Name:
<INPUT MAXLENGTH=30 NAME=lname type=text size=15 value="[value lname]" ><br>

*Email:
<INPUT MAXLENGTH=30 NAME=email type=text size=15 value="[value email]"><br>
<P>

[set Check_form]
&success=feedback2
&fail=@@MV_PAGE@@
email=required
&fatal=1
[/set]

<input type="image" alt="Search Go" width="57" border="0"
src="__THEME_IMG_DIR__go.gif">

</form>
--------- end -------------

and here's the feedback2.html

------- begin feedback2.html ---------
[email hide=1
to="Feedback@MyDomain.com"
subject="Feedback"
from="[value email]"
reply="[value email]"]

First Name= [value fname]
Last Name= [value lname]
Email= [value email]

Model= [value Model]
Type= [value Type]
Code= [value Code]

PN1= [value PN1]
Description1= [value Description1]

PN2= [value PN2]
Description2= [value Description2]

PN3= [value PN3]
Description3= [value Description3]

PN4e= [value PN4]
Description4= [value Description4]

[/email]


<P><br>Thanks.. got it!
----- end ------------------