Hey all,

As the title of this thread suggests I am having some troubles with
the validation jQuery plugin.

Here's the code I am using:

<script src="http://code.jquery.com/jquery-latest.js";></script>
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/
plugins/validate/lib/jquery.delegate.js"></script>
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/
plugins/validate/jquery.validate.js"></script>
<script>
$(document).ready(function(){
        $("#form_email_38366").validate({
                rules: {
                        q38373_q3: "required"
                        },
                        q38373_q6: {
                                required: "#q38373_q5_0:checked, 
#q38373_q5_1:checked"
                        },
        });
        $("#q38373_q2_0, #q38373_q2_1, #q38373_q2_2").click(function() {
                alert("hello" + $("#q38373_q3").valid());
        });
        $("#q38373_q5_0, #q38373_q5_1").click(function() {
                alert("hello");
                $("#q38373_q6").valid();
        });
});
</script>
<style>
label { font-family: Arial, Helvetica, sans-serif; font-size: small; }
br { clear: both; }
input { border: 1px solid black;  }
label.error {
        display:none;
        background: red;
        padding-left: 16px;
        margin-left: .3em;
}
label.valid {
        background: green;
        display: block;
        width: 16px;
        height: 16px;
}
</style>
<form id="form_email_38366" enctype="multipart/form-data" action="/
intranet/it_policies__and__procedures/it_systems_use_survey/_nocache"
method="post" >

<ul><li><input type="radio" name="q38373:q2" id="q38373_q2_0"
value="0"  class="sq-form-field" />&nbsp;<label for="q38373_q2_0">1 -
Poor</label></li><li><input type="radio" name="q38373:q2"
id="q38373_q2_1" value="1"  class="sq-form-field" />&nbsp;<label
for="q38373_q2_1">2 - Below Average</label></li><li><input
type="radio" name="q38373:q2" id="q38373_q2_2" value="2"
checked="checked"  class="sq-form-field" />&nbsp;<label
for="q38373_q2_2">3 - Average</label></li><li><input type="radio"
name="q38373:q2" id="q38373_q2_3" value="3"  class="sq-form-field" /
>&nbsp;<label for="q38373_q2_3">4 - Good</label></li><li><input
type="radio" name="q38373:q2" id="q38373_q2_4" value="4"  class="sq-
form-field" />&nbsp;<label for="q38373_q2_4">5 -Very Good</label></
li></ul>

<label  for="q38373_q3">If your response was 1 or 2 - Please Explain</
label><textarea name="q38373:q3" cols="40" rows="3" onkeypress="if
(this.value.length > 100) { this.value = this.value.substr(0,100);
alert(js_translate('max_characters_warning', '100')); this.focus()}"
id="q38373_q3" class="sq-form-field"></textarea>

<ul><li><input type="radio" name="q38373:q5" id="q38373_q5_0"
value="0"  class="sq-form-field" />&nbsp;<label for="q38373_q5_0">1 -
Poor</label></li><li><input type="radio" name="q38373:q5"
id="q38373_q5_1" value="1"  class="sq-form-field" />&nbsp;<label
for="q38373_q5_1">2 - Below Average</label></li><li><input
type="radio" name="q38373:q5" id="q38373_q5_2" value="2"  class="sq-
form-field" />&nbsp;<label for="q38373_q5_2">3 - Average</label></
li><li><input type="radio" name="q38373:q5" id="q38373_q5_3"
value="3"  class="sq-form-field" />&nbsp;<label for="q38373_q5_3">4 -
Good</label></li><li><input type="radio" name="q38373:q5"
id="q38373_q5_4" value="4"  class="sq-form-field" />&nbsp;<label
for="q38373_q5_4">5 - Very Good</label></li></ul>

<label  for="q38373_q6">If your response was 1 or 2, Please explain</
label><textarea name="q38373:q6" cols="40" rows="3" onkeypress="if
(this.value.length > 1000) { this.value = this.value.substr(0,1000);
alert(js_translate('max_characters_warning', '1000')); this.focus()}"
id="q38373_q6" class="sq-form-field"></textarea>

<input type="submit" name="form_email_38366_submit" value="Submit"
class="sq-form-field" id="form_email_38366_submit" /> <input
type="submit" name="form_email_38366_reset" value="Reset"  class="sq-
form-field" id="form_email_38366_reset" />
</form>

I am linking off to the external files for now just for testing
purpose's, as I do not have complete access to the server I am using
just now.
Otherwise I would of uploaded the files and linked to them
accordingly.

Any help would be greatly appreciated! :)

Regards,

J Gillies



Reply via email to