Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript functions
    primarykey
    data
    text
    <p>I have 3 javascript functions:</p> <p><code>validateClk()</code>, <code>validateAmPm()</code> and <code>getClks()</code></p> <p>And on two occurring events, they get executed as follows:</p> <p><code>OnChange</code> - executes <code>validateClk()</code> and <code>validateAmPm()</code></p> <p><code>OnClick</code> - executes <code>getClks()</code> (<code>getClks()</code> returns a boolean value)</p> <p>All 3 functions run correctly, but the problem is, after <code>getClks()</code> has finished execution and returns a boolean, the next function <code>postClocks()</code> doesn't run. I'm very sure that the code for <code>postClocks()</code> is correct as well. If I don't use the return statement for <code>getClks()</code> then the <code>getClks()</code> function doesn't work as expected. </p> <p>Please help :(</p> <pre><code>&lt;script type='text/javascript'&gt; function validateClk() { .... var clks = clocks.value; if (clks == "") { alert('Enter time'); } else { ... } } &lt;/script&gt; &lt;script type='...'&gt; function validateAMPM() { ... var ampm= ap.value; if (ampm=="") { alert('Enter am or pm'); } } &lt;/script&gt; &lt;script type='text/...'&gt; function getClks() { var clks= clock.value; var ampm= ap.value; if (clks==" &amp;&amp; ampm="") { alert('Enter time and am/pm'); return false; } else { ... } return true; } &lt;/script&gt; &lt;... onChange="validateClk(); validateAmPm();" /&gt; &lt;... button label="Submit" onClick="return getClks(); postClocks(); return false;" /&gt; </code></pre>
    singulars
    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.
    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