thanks again for the reply,
Here is the full code of what i am using....
for the js I have...
Code:
if($("#addImageForm").size() > 0){
$().ready( function() {
$("#addImageForm").validate({
event: "keyup",
rules: {
image_title: { required: true },
image_filename:{ required: true,
accept: "(jpe?g|gif|png|GIF|JPG|PNG)"
}
},
messages: {
image_title: "The Image needs a name",
image_filename: {
required: "You need to select an image to upload",
accept:"Only image files are allowed. (gif, jpg or png)"
}
}
});
});
and the html code is
Code:
<form method="post" class="addform" id="addImageForm" enctype="multipart/form-data" >
<input type="hidden" name="process_form" />
<table>
<tr>
<td>Image Name</td>
<td><input type="text" id="image_title" name="image_title" /></td>
</tr>
<tr>
<td colspan="2">Add a short description for the Picture below</td>
</tr>
<tr>
<td colspan="2"><textarea id="image_description" name="image_description" cols="45" rows="50" ></textarea></td>
</tr>
<tr>
<td>Image Filename</td>
<td><input class="{accept:true}" type="file" id="image_filename" name="image_filename" /></td>
</tr>
<tr>
<td><input type="submit" name="submit" value="Add Image" /></td>
<td><input type="reset" name="reset" value="Reset" /></td>
</tr>
</table>
</form>
So basically I want to do the error checking when the above form exists.
At the moment it does not execute the code whether the form is on that page or not - but it doesnt error either.
I placed an alert in the js if statement and it doesnt pop up ever?
:s
Bookmarks