Hello, as you remember we already had a chat and you said that I like to chat, but you didn't say that you needed to edit a javascript code and that you needed to validate your user side form, you said that there was nothing to code. Here I edited your javascript code and only one thing is left. On this line: "var imageURL = $('#imageurlinputid').val().split('.').pop().toLowerCase();" you must change "imageurlinputid" with an Image URL's input field id (which you must have in your HTML form) to make it clear you can find that for "Image browse" it will be "file" and for image description it will be "description" so you must find the same kind of thing for "Image URL" and paste it int the following javascript code (if this is what you want, use it for free, don't choose my bid):
function validate_ext()
{
var ext = $('#file').val().split('.').pop().toLowerCase();
var imageURL = $('#imageurlinputid').val().split('.').pop().toLowerCase();
var message_des=$('#description').val();
if($('#file').val() != '' && $.inArray(ext, ['gif','png','jpg','jpeg']) == -1)
{
alert('Invalid extension! Must Browse for file type jpg , png , gif , bmp,');
return false;
}
else if($.inArray(imageURL, ['gif','png','jpg','jpeg']) == -1)
{
alert('Invalid extension! Image URL must be a file of type jpg , png , gif , bmp,');
return false;
}
if(message_des==""){
alert('Must enter the Image description.');
return false;
}
}