0

i have code in form

  • no submit any thing: <div class="screen-reader-response"></div>
  • submit : <div class="screen-reader-response" role="alert">My Content alert<div>

i'm user code :

$( ".screen-reader-response" ).dialog();

problems : when i'm don't submit any thing is: echo dialog with no content

how to setup:

if: no submit any thing: <div class="screen-reader-response"></div> no echo alert if: have submit: <div class="screen-reader-response" role="alert">My Content alert<div> echo alert My Content alert

give me any idea?

visit my site: http://www.graylinecruisehalong.net/ always dialog content when don't submit?

2
  • Clarify your question and put a JSFiddle example Commented Aug 23, 2014 at 3:01
  • how to run jquery ui in JSFiddle? no submit any thing: jsfiddle.net/sfmoetrs submit: jsfiddle.net/sfmoetrs/1 Commented Aug 23, 2014 at 3:06

1 Answer 1

1

When no submit:

$(".screen-reader-response").html("").dialog('open');

When submit:

$(".screen-reader-response").html("My Content alert").dialog('open');    

To initialize dialog with more options then please check the documentation of jquery dialog at: http://api.jqueryui.com/dialog/

Sign up to request clarification or add additional context in comments.

6 Comments

i'm use $( ".screen-reader-response" ).dialog(); is run, but don't want run if no content in #myDialog
Yes, i have update the code. Please check it. I think it is what you are looking for.
i'm add code : when no submit => no echo dialog (true) - but when i'm sumit => no echo dialog (false) ???
$(".screen-reader-response").html("My Content alert").dialog('open'); if html("My Content alert") have not one value ?? how to open ?
For that I have mentioned in the answer right as when no submit.
|

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.