4

How can I show an error message using tooltip on click of a button and that too if there is error, else the button should just work fine to submit the form?

Here is what I have tried with modal dialog

$.fx.speeds._default = 1000;
$(function() {
 $('#dialog').dialog({autoOpen:false,show:'blind',hide:'explode'});
 $('#savej').click(function(){$('#dialog').dialog('open');return false;});
});
11
  • 2
    How does Java factor into this? Commented Jun 9, 2010 at 14:54
  • well ..my form submission is in java. So I just added that as a tag.I know it's not related to that. Commented Jun 9, 2010 at 14:59
  • java and javascript are two different "animals" Commented Jun 9, 2010 at 15:04
  • must it use a tooltip. or would a modal dialog be useful. Commented Jun 9, 2010 at 15:18
  • What code do you have so far for your submit function? Commented Jun 9, 2010 at 15:27

1 Answer 1

2
$('#savej').click(function(e){
    if (hasErrors()) { // Some checking for errors
        e.preventDefault();
        $('#dialog').dialog('open');
    }
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.