Note that there are some explanatory texts on larger screens.

plurals
  1. POwhy does my jquery dialog box disappears after a few seconds?
    primarykey
    data
    text
    <p>i have a form with a textarea and a button. if the button is clicked while the textarea is empty, the form will reload and generate an error message. otherwise, the form will redirect to another page. now, i integrated a jquery dialog box. when the button is clicked the dialog box should appear and ask a yes or no question. the problem is when i click the button the dialog box appears but disappears after a few seconds. how can i fix this? i'm using php for the form and jquery for the dialog box. </p> <p>ps. in php, when you click a button in a form the page will reload right? i think this has something to do with the disappearing of the box because it disappears right before it reloads.</p> <p>here's my code</p> <pre><code> &lt;form id="form1" name="form1" method="post" action="&lt;? echo $PHP_SELF; ?&gt;" enctype="multipart/form-data" onsubmit="myRedirect();"&gt; &lt;p class="style16"&gt; &lt;div align="left"&gt; &lt;p&gt;&lt;span class="style5"&gt;Rules:&lt;/span&gt; &lt;? if($_POST['continue']) { if($_POST['rules']==null) { echo $_SESSION['nature']."&lt;font color='red' size='3'&gt;&lt;b&gt;Please enter the rules.&lt;/b&gt;&lt;/font&gt;&lt;br&gt;"; } } ?&gt; &lt;input type="hidden" name="other_id" value="&lt;? echo $_SESSION['other_id']; ?&gt;"&gt; &lt;input type="hidden" name="hidden1" value="&lt;? echo $_SESSION['hidden1']; ?&gt;"&gt; &lt;/p&gt; &lt;p&gt; &lt;textarea name="rules" rows="7" cols="49"&gt;&lt;/textarea&gt; &lt;br /&gt; &lt;/p&gt; &lt;div id="dialog" title="Empty the recycle bin?"&gt; &lt;p&gt;&lt;span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"&gt;&lt;/span&gt;Is the judge/speaker/facilitator from UST?&lt;/p&gt; &lt;/div&gt; &lt;p&gt;&lt;input type="submit" name="continue" id="continue" value="Continue"/&gt; &lt;input type="reset" name="clear" value="Clear"&gt;&lt;/p&gt; &lt;center&gt; &lt;!--&lt;input type="submit" name="clear2" id="clear2" value="Clear" onClick="textfield.value="" textfield2.value="" textarea.value="" textarea2.value="" textarea3.value="" textarea4.value="" textarea5.value="" textarea6.value="" file.value="" "/&gt;--&gt; &lt;/center&gt; &lt;/p&gt; &lt;/div&gt; &lt;/form&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload