Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML and form validation

Status
Not open for further replies.

toolkit

Programmer
Aug 5, 2001
771
GB
Hi there,

Fairly new to XML. Was wondering about the best way to go progress with an idea of using an xml file to generate a an HTML form, and perform some intelligent validation, eg:
Code:
<parameters>
  <parameter name=&quot;firstName&quot;>
    <title>First Name</title>
    <validation type=&quot;string&quot; />
  </parameter>
  <parameter name=&quot;start&quot;>
    <title>Start Date</title>
    <validation type=&quot;date&quot;>
       <earlierThan name=&quot;end&quot;>
    </validation>
  </parameter>
  <parameter name=&quot;end&quot;>
    <title>End Date</title>
    <validation type=&quot;date&quot;>
      <laterThan name=&quot;start&quot;>
    </validation>
  </parameter>
</parameters>
This xml could then be used to generate a sensible onSubmit handler in Javascript, or maybe even separate onChange handlers... Has anyone else had a go at anything similar, and could suggest approaches to try / avoid.

Thanks for any advice, cheers Neil
 
Oops. Didn't close off my
Code:
<earlierThan>
or
Code:
<laterThan>
tags :~/
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top