I am not a javascript expert in anyway, but I have found it to be very easy to add cool javascript validation to your forms using "real easy validation". This is how I have done it - if it doesn't work for you - sorry, can try to help but best bet would be to go to the real easy validation www site below
[list=1]
first down load and install the following on your server
a) download the scriptaculous library (for effects) from http://script.aculo.us
b) download prototype (make sure you get a version which works with the scriptaculous you downloaded above) from http://www.prototypejs.org
c) download validation.js from http://www.tetlaw.id.au/view/javascript/really-easy-field-validation
then make the following HACKS!!! to chronocontact.html.php
a) add the following just above the form opening tag
b) add an id attribute to form tag
c) add the following just after the form closing tag
then in your forms follow the instructions to add class="required" as needed. For example:
Should look like this

[/list:o]
Post edited by: bouton, at: 2007/08/02 16:00
Post edited by: bouton, at: 2007/08/02 16:01
Post edited by: bouton, at: 2007/08/02 16:02
Post edited by: bouton, at: 2007/08/02 16:04
Post edited by: bouton, at: 2007/08/02 16:37<br><br>Post edited by: bouton, at: 2007/08/02 16:39
[list=1]
a) download the scriptaculous library (for effects) from http://script.aculo.us
b) download prototype (make sure you get a version which works with the scriptaculous you downloaded above) from http://www.prototypejs.org
c) download validation.js from http://www.tetlaw.id.au/view/javascript/really-easy-field-validation
a) add the following just above the form opening tag
<script src="/your/path/to/prototype.js" type="text/javascript"></script>
<script src="/your/path/to/effects.js" type="text/javascript"></script>
<script src="/your/path/to/validation.js" type="text/javascript"></script>
b) add an id attribute to form tag
<form name="<?php echo "ChronoContact_".$rows[0]->name; ?>" id="<?php echo "ChronoContact_".$rows[0]->name; ?>" enctype="multipart/form-data" method="<?php echo $paramsvalues->formmethod; ?>" action="<?php echo $actionurl; ?>" <?php echo $rows[0]->attformtag; ?>>
c) add the following just after the form closing tag
<script type="text/javascript">
function formCallback(result, form) {
window.status = "valiation callback for form '" + form.id + "': result = " + result;
}
var valid = new Validation('<?php echo "ChronoContact_".$rows[0]->name; ?>', {immediate : true, onFormValidate : formCallback});
</script>
<div class="reg_form">
<fieldset>
<legend>Registration</legend>
<div class="form-row">
<div class="field-label-wide">
<label for="agree">I agree to the above terms of usage:</label>
</div>
<div class="field-label">
<input type="radio" name="agree" value="0" /> I don't agree.<br/>
<input type="radio" name="agree" value="1" title="You must agree in order to register" class="required validate-one-required" /> I agree.
</div>
</div>
<div id="agree_license" class="form-row">
<div class="form-row">
<div class="field-label">
<label for="name">Your name </label>:
</div>
<div class="field-widget">
<input name="name" id="name" title="Please Enter your name" class="required"/> (Required)
</div>
</div>
<div class="form-row">
<div class="field-label">
<label for="institution">Your Institution</label>:
</div>
<div class="field-widget">
<input name="institution" id="institution" title="Please enter your Institution" class="required"/> (Required)
</div>
</div>
<div class="form-row">
<div class="field-label">
<label for="email_address">Your email address</label>:
</div>
<div class="field-widget">
<input name="email_address" id="email_address" title="Please enter your email address" class="required validate-email"/> (Required)
</div>
</div>
<div class="form-row">
<input name="submit" value="Click here to proceed" type="submit" />
</div>
</div>
</fieldset>
</div>

Post edited by: bouton, at: 2007/08/02 16:00
Post edited by: bouton, at: 2007/08/02 16:01
Post edited by: bouton, at: 2007/08/02 16:02
Post edited by: bouton, at: 2007/08/02 16:04
Post edited by: bouton, at: 2007/08/02 16:37<br><br>Post edited by: bouton, at: 2007/08/02 16:39