jAlert plugin help

classic Classic list List threaded Threaded
2 messages Options
MGA
Reply | Threaded
Open this post in threaded view
|

jAlert plugin help

MGA

I can't seem to set the focus back to a text field after a jAlert
message. This is the code:

 function divCheck() {
   if (document.form1.First_Name.value.length==0){
   jAlert("Please enter your First Name.", "Attention");
   document.form1.First_Name.focus();
   return false;
   }
Reply | Threaded
Open this post in threaded view
|

Re: jAlert plugin help

Arit
jAlert contains three parameter.
1. Alert message.
2. Alert title(optional)
3. Callback function (optional).

jAlert always perform only those statement which are declare in it's callback function.
So code should be like this.
 
jAlert('Category name cannot be empty.', 'Category Alert',function(){$('#cat_name').focus();});
      return false;