Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

box unchecks itself on submit

Status
Not open for further replies.

olivia

Programmer
Apr 10, 2000
8
US
Hi there, annoying glitch - have a medical calculator which takes values and passes them to a child window, the checkbox that is scripted with an &quot;if else&quot; unchecks itself on submit, although the correct value is passed. If you go back to the parent window and submit again, the unchecked value is passed the next time.&nbsp;&nbsp;Other check boxes scripted with only an &quot;if&quot; statement remain checked. The box in question &quot;istakingmed: is not referenced again in the script. Any ideas??<br><br>sample errant code:<br><FONT FACE=monospace>if ( document.adder.istakingmed.checked && tsbpcalc &gt;= 149 && tsbpcalc &lt;= 160) {<br>document.adder.outputtsbp.value=&quot;8&quot;;<br>document.adder.treatbpstat.value=&quot;With a treated systolic blood pressure of &quot; + tsbpcalc + &quot;.&lt;br&gt;&quot;;<br>}else if ( document.adder.istakingmed.checked == false && tsbpcalc &gt;= 181 && tsbpcalc &lt;= 192) {<br>document.adder.outputtsbp.value=&quot;8&quot;;<br>document.adder.treatbpstat.value=&quot;With an untreated systolic blood pressure of &quot; + tsbpcalc + &quot;.&lt;br&gt;&quot;; <br>}</font>
 
I took a real quick look at your code so I don't know if the following will help.<br><br>Try putting parenthesis around <FONT FACE=monospace>tsbpcalc &gt;= 149</font>, <FONT FACE=monospace>tsbpcalc &lt;= 160</font>, <FONT FACE=monospace>document.adder.istakingmed.checked == false</font>, <FONT FACE=monospace>tsbpcalc &gt;= 181</font>, <FONT FACE=monospace>tsbpcalc &lt;= 192</font> <br>(it would look something like this: <FONT FACE=monospace><br>if ( (document.adder.istakingmed.checked) && (tsbpcalc &gt;= 149) && (tsbpcalc &lt;= 160) )</font><br>).&nbsp;&nbsp;<br><br>Browsers often complain about these things.&nbsp;&nbsp;They like it when code <p>REH<br><a href=mailto:hawkdogg@crosswinds.net>hawkdogg@crosswinds.net</a><br><a href= by Linux</a><br>Learn Linux and Leave out the Windows :)
 
hmm, that didn't seem to work. It's still unchecking itself Any other ideas? Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top