473,748 Members | 6,161 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

odd behavior in IE for Mac

Hello all.

I wrote a client-side form evaluation script that runs as expected in
Firefox, Netscape, and IE for PC, but fails in IE for Mac.

The formEval() method is called from the onSubmit event in the FORM
element, and on IE for Mac it shows the desired page for an instant and
then immediately reloads the form page. The pertinent code is:

<snip>

function formEval() {
var q1result = q1eval();
var q2result = q2eval();
var q3result = q3eval();
var q4result = q4eval();
var q5result = q5eval();
var q6result = q6eval();
var q7result = q7eval();
var q8result = q8eval();
var q9result = q9eval();
var q10result = q10eval();
document.close( );
document.open() ;
document.write(
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"\
"http://www.w3.org/TR/html4/loose.dtd">\
<html>\
<head>\
<link rel="stylesheet " href="parentEdS tyles.css"
type="text/css">\
</head>\
\
<body>\
<div id="Menu">\

<!-- ... -->

<tr>\
<td>&nbsp;</td>\
<td>' + q10result + '</td>\
</tr>\
</table>\
</div>\
</div>\
<div class="next"><a class="continue "
href="./index.html">hom e</a></div>\
</body>\
</html>'
);
document.close( );
}

</snip>

Everything is very straightforward (wrt the qNresult assignment), and
the full script can be seen at
http://www.rankfamily.com/joe/parentEd/test.html

Any suggestions are welcome.

Thanks,

Joe

Jul 23 '05 #1
6 1450
J.A.Rank wrote:
Hello all.

I wrote a client-side form evaluation script that runs as expected in
Firefox, Netscape, and IE for PC, but fails in IE for Mac.

The formEval() method is called from the onSubmit event in the FORM
element, and on IE for Mac it shows the desired page for an instant and
then immediately reloads the form page. The pertinent code is:
I don't have access to IE 5 for Mac right now, but I will later. In
the meantime, I suspect what is happening is that the script writes
the new page, but then because the form is submitted to itself, the
form is re-loaded.

Have the onsubmit return false:

<form onSubmit="formE val(); return false;"
name="selfTest" action="">

Form elements also require an action attribute.

Your page may work in other browsers because document.write destroys
the form so it doesn't submit, or they think it's cached so do
nothing. In some browsers, loading a new page stops a script
completing, in others it doesn't - the script will run to the end
then load the new page.

Your method here is very verbose - you could put the answers into an
array or object, then simply loop through it and compare to the
users' answers. It would also be better to write the results
directly to the page and hide the form rather than loading a new page
created with document.write.

The resulting code would be far simpler and easier to maintain. I'll
post a version later when I can get to Mac to validate the above.

And if JavaScript is not enabled, the form should submit and be
processed server-side.

<snip>

function formEval() {
var q1result = q1eval();
var q2result = q2eval();
var q3result = q3eval();
var q4result = q4eval();
var q5result = q5eval();
var q6result = q6eval();
var q7result = q7eval();
var q8result = q8eval();
var q9result = q9eval();
var q10result = q10eval();
document.close( );
document.open() ;
document.write(
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"\
"http://www.w3.org/TR/html4/loose.dtd">\
<html>\
<head>\
<link rel="stylesheet " href="parentEdS tyles.css"
type="text/css">\
</head>\
\
<body>\
<div id="Menu">\

<!-- ... -->

<tr>\
<td>&nbsp;</td>\
<td>' + q10result + '</td>\
</tr>\
</table>\
</div>\
</div>\
<div class="next"><a class="continue "
href="./index.html">hom e</a></div>\
</body>\
</html>'
);
document.close( );
}

</snip>

Everything is very straightforward (wrt the qNresult assignment), and
the full script can be seen at
http://www.rankfamily.com/joe/parentEd/test.html

Any suggestions are welcome.

Thanks,

Joe

--
Rob
Jul 23 '05 #2
J.A.Rank wrote:
Hello all.
[...]
Any suggestions are welcome.


While playing with this I noticed the following serious issue: the
questions and answers are mis-aligned and the test response is very
inadequate.

For example, if I select the first or second answer to Q8, I get:

8. Talking about protection from child abusers is the job of
school teachers, not the job of parents.
Incorrect. The correct answer is "5-year-olds are in no danger".
Even if you fix this mis-alignment of question and response, the
message is probably not one you are trying to promote.

I'd suggest you put the responses into an array, or have them in the
HTML, and reveal them *regardless* of how the question is answered.
The script should only decide whether or not the visitor got it
right.

So for Q8. the response might be:

8. Your answer is correct.
Never hitchhike and always use the buddy system.
ALL children are in danger, including 5 year-olds.

Just giving 'Correct' does not reinforce the message you are trying
to deliver. Please get someone who knows what they are doing to look
over your test and validate both the questions and the responses.

This is a serious subject, you need to get it absolutely right.
--
Rob
Jul 23 '05 #3
J.A.Rank wrote:
Hello all.

I wrote a client-side form evaluation script that runs as expected in Firefox, Netscape, and IE for PC, but fails in IE for Mac.
(snip)
Everything is very straightforward (wrt the qNresult assignment), and the full script can be seen at
http://www.rankfamily.com/joe/parentEd/test.html

Any suggestions are welcome.

Thanks,

Joe


Well, you've got a messy admixture of (inline) CSS & HTML attributes
there, and the quiz itself should be in an ordered list rather than a
table. Please: don't document.write an 'answer' page! Leave sleeping
pages lie. Here's a possible solution, uses innerHTML as I'm too tired
at the moment to build subtrees.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet " href="parentEdS tyles.css" type="text/css">
<style type="text/css">

..answer {
display: none;
width: 90%;
font: normal 12px tahoma;
color: #fff;
padding: 5px;
margin: 4px 0;
border: 1px #fff solid;
background: #600;
}
..answer ol {
margin: 0;
}
td {
padding-bottom: 16px;
}
td.rtalign {
text-align: right;
vertical-align: top;
}

</style>
</head>
<body>
<script type="text/javascript">

var answers =
{
a1:

"<ol><li>Recogn ize: acknowledge the problem." +
"<li>Resist : resolve to take contrary action." +
"<li>Report : inform the appropriate authorities.</ol>"

,a2:

"Contrary to much popular belief, the person " +
"most likely to commit child abuse is a trusted " +
"member of the child's immediate family, " +
"or a friend or relative."

,a3:

"Or...you could just shoot the bastard."
}

function getRadioValue(g rp)
{
var i = grp.length;
do
if (grp[--i].checked)
return grp[i].value;
while (i);
return null;
}

function grade(els)
{
var grp, val, ans, msg, n = 1;
while (grp = els['q' + n])
{
val = getRadioValue(g rp);
if (val == 'c')
msg = 'Correct.<br><b r>' + answers['a' + n];
else if (!val)
msg = 'You did not answer the question.';
else msg = 'Incorrect.<br> <br>' + answers['a' + n];
if (ans = document.getEle mentById('a' + n))
{
ans.innerHTML = msg;
ans.style.displ ay = 'block';
}
n++;
}
window.scrollTo (0,0);
}

</script>
<div id="Menu">
<a class="nav" href="index.htm l">home</a><br>
<a class="nav" href="p2.html"> introduction</a><br>
<a class="nav" href="obj.html" >objectives</a><br>
<a class="nav" href="def.html" >definition</a><br>
<a class="nav" href="kinds.htm l">four kinds of abuse</a><br>
<a class="nav" href="signs.htm l">signs of abuse</a><br>
<a class="nav" href="phys.html ">physical abuse</a><br>
<div style="text-align: center;">
<a class="nav" href="obs_phys. html">observabl e signs</a>
</div>
<div style="text-align: center;">
<a class="nav" href="behav_phy s.html">behavio ral signs</a>
</div>
<a class="nav" href="neg.html" >neglect</a><br>
<div style="text-align: center;">
<a class="nav" href="obs_neg.h tml">observabl e signs</a><br>
</div>
<div style="text-align: center;">
<a class="nav" href="behav_neg .html">behavior al signs</a>
</div>
<a class="nav" href="sex.html" >sexual abuse</a><br>
<div style="text-align: center;">
<a class="nav" href="signs_sex .html">observab le signs</a><br>
</div>
<div style="text-align: center;">
<a class="nav" href="behav_sex .html">behavior al signs</a>
</div>
<a class="nav" href="emo.html" >emotional abuse</a><br>
<div style="text-align: center;">
<a class="nav" href="signs_emo .html">behavior al signs</a>
</div>
<a class="nav" href="rep1.html ">reporting </a><br>
<a class="nav" href="pro.html" >protecting</a><br>
<a class="nav" href="3rs.html" >the three R's</a><br>
<a class="nav" href="teach3rs. html">teaching three R's</a><br>
<a class="nav" href="rec.html" >recognize</a><br>
<a class="nav" href="res.html" >resist</a><br>
<a class="nav" href="rep.html" >report</a><br>
<a class="nav" href="rules.htm l">basic rules 1</a><br>
<a class="nav" href="rules2.ht ml">basic rules 2</a><br>
<a class="nav" href="law.html" >the law</a><br>
<a class="nav" href="concl.htm l">conclusio n</a><br>
<a class="nav" href="creds.htm l">credits</a><br>
<a class="nav" href="test.html ">self test</a><br>
</div>
<div id="Content">
<!-- content -->
<form onsubmit="grade (this.elements) ;return false;" name="selfTest" >
<div style="font-weight: normal; font-size: 12pt">
<table width="100%" cellspacing="0" cellpadding="4" >
<tr>
<td class="rtalign" width="10%">1.</td>
<td style="vertical-align: top;" width="50%" height="100%">
What are the 3 R's of child abuse prevention?
<div id="a1" class="answer"> </div>
</td>
<td width="40%">
<input type="radio" name="q1" value="i">relax , relegate, and
regret</input><br>
<input type="radio" name="q1" value="i">retre at, regroup, and
revenge</input><br>
<input type="radio" name="q1" value="c">recog nize, resist, and
report</input><br>
<input type="radio" name="q1" value="i">revie w, reveal, and
relief</input><br>
</td>
</tr>
<tr>
<td class="rtalign" >2.</td>
<td style="vertical-align: top">
Child Abuse is most often committed by a family member or someone
who is known to the child.
<div id="a2" class="answer"> </div>
</td>
<td style="vertical-align: top">
<input type="radio" name="q2" value="c">true</input>
<input type="radio" name="q2" value="i">false </input>
</td>
</tr>
<tr>
<td class="rtalign" >3.</td>
<td style="vertical-align: top">
The best thing for any child to say to a person who is touching
them or talking to them in a wrong way is:
<div id="a3" class="answer"> </div>
</td>
<td style="vertical-align: top">
<input type="radio" name="q3" value="i">What are you doing?</input><br>
<input type="radio" name="q3" value="i">Pleas e cut that
out.</input><br>
<input type="radio" name="q3" value="c">STOP! I'M TELLING!</input><br>
</td>
</tr>
<tr>
<td class="rtalign" >4.</td>
<td style="vertical-align: top">
Children may be afraid to tell about abuse because they may think
they are to blame.
</td>
<td style="vertical-align: top">
<input type="radio" name="q4" value="c">true</input>
<input type="radio" name="q4" value="i">false </input>
</td>
</tr>
<tr>
<td class="rtalign" >5.</td>
<td style="vertical-align: top">
Abusers are easy to spot.They are poor and look frightening.
</td>
<td style="vertical-align: top">
<input type="radio" name="q5" value="i">true</input>
<input type="radio" name="q5" value="c">false </input>
</td>
</tr>
<tr>
<td class="rtalign" >6.</td>
<td style="vertical-align: top">
Children have the right to:
</td>
<td style="vertical-align: top">
<input type="radio" name="q6" value="c">refus e certain kinds of
contact</input><br>
<input type="radio" name="q6" value="i">refus e any and all
contact</input><br>
<input type="radio" name="q6" value="i">rejec t uncomfortable
authority</input><br>
<input type="radio" name="q6" value="i">refus e guidance from
parents</input><br>
</td>
</tr>
<tr>
<td class="rtalign" >7.</td>
<td style="vertical-align: top">
Talking about protection from child abusers is the job of school
teachers, not the job of parents.
</td>
<td style="vertical-align: top">
<input type="radio" name="q7" value="i">true</input>
<input type="radio" name="q7" value="c">false </input>
</td>
</tr>
<tr>
<td class="rtalign" >8.</td>
<td style="vertical-align: top">
Select the rule that was NOT listed in the basic safety rules for
children.
</td>
<td style="vertical-align: top">
<input type="radio" name="q8" value="i">Never hitchhike.</input><br>
<input type="radio" name="q8" value="i">Alway s use the buddy
system.</input><br>
<input type="radio" name="q8" value="c">5 year-olds are in no
danger.</input>
</td>
</tr>
<tr>
<td class="rtalign" >9.</td>
<td style="vertical-align: top">
If I believe that my child is being abused I can call
</td>
<td style="vertical-align: top">
<input type="radio" name="q9" value="i">my child's friends</input><br>
<input type="radio" name="q9" value="i">the suspected
abuser</input><br>
<input type="radio" name="q9" value="c">Child Protective
Services</input><br>
<input type="radio" name="q9" value="c">the police</input>
</td>
</tr>
<tr>
<td class="rtalign" >10.</td>
<td style="vertical-align: top">
All citizens in Texas are required by law to report child abuse.
</td>
<td style="vertical-align: top">
<input type="radio" name="q10" value="c">true</input>
<input type="radio" name="q10" value="i">false </input>
</td>
</tr>
<tr>
<td colspan="3" style="text-align: center">
<input type="submit" value="Score Self-test">
</td>
</tr>
</table>
</div>
</form>
<!-- /content -->
</div>
<div class="next"><a class="continue "
href="./index.html">hom e</a></div>
</body>
</html>

Jul 23 '05 #4
RobB wrote:
J.A.Rank wrote:
Hello all.

I wrote a client-side form evaluation script that runs as expected in


Firefox, Netscape, and IE for PC, but fails in IE for Mac.

(snip)

Everything is very straightforward (wrt the qNresult assignment), and


the full script can be seen at
http://www.rankfamily.com/joe/parentEd/test.html

Any suggestions are welcome.

Thanks,

Joe

Well, you've got a messy admixture of (inline) CSS & HTML attributes
there, and the quiz itself should be in an ordered list rather than a
table. Please: don't document.write an 'answer' page! Leave sleeping
pages lie. Here's a possible solution, uses innerHTML as I'm too tired
at the moment to build subtrees.

[...]

To the OP:

Use RobB's suggestions on style, here is an example of the 'add
content' method I suggested above.

Please validate your HTML, there are no closing </input> tags, they
are forbidden in HTML 4.01. Add title and charset elements.

Note changes to opening form tag, and add a class for 'response' that
puts the text in light blue (say #aaaaee).

Below is a chunk of page, I've cut about half of it out in the
middle, you'll need to replace it. The page should be less than half
the length of yours, it works in IE (Mac & Windows), Firefox and
Safari.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> page title </title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet " href="parentEdS tyles.css" type="text/css">
</head>
<body>
<script type="text/javascript">
function formEval(f) {
// Get a reference to all the form elements
var r=f.elements;

// Go through one at a time
var i=r.length;
var t, v;

while (i--) {

// If we get a question element
if ( (t=f.elements['q'+i]) ) {

// Get the value of the checked button
v=getV(t);

// If it's 'c'
if ( 'c' == v ) {
document.getEle mentById('q' + i + 'c').style.disp lay='';
document.getEle mentById('q' + i + 'i').style.disp lay='none';

// In all other cases
} else {
document.getEle mentById('q' + i + 'c').style.disp lay='none';
document.getEle mentById('q' + i + 'i').style.disp lay='';
}

// Show the response statement
document.getEle mentById('q' + i + 's').style.disp lay='';
}
}
}

// Get the value of the checked radio button
// Return 'i' if none checked
function getV(x){
var i=x.length;
while (i-- && !x[i].checked) {}
return (0 > i)? 'i' : x[i].value;
}
</script>

<div id="Menu">
<a class="nav" href="index.htm l">home</a><br>
<a class="nav" href="p2.html"> introduction</a><br>
<a class="nav" href="obj.html" >objectives</a><br>
<a class="nav" href="def.html" >definition</a><br>
<a class="nav" href="kinds.htm l">four kinds of abuse</a><br>
<a class="nav" href="signs.htm l">signs of abuse</a><br>
<a class="nav" href="phys.html ">physical abuse</a><br>
<div style="text-align: center;">
<a class="nav" href="obs_phys. html">observabl e signs</a>
</div>
<div style="text-align: center;">
<a class="nav" href="behav_phy s.html">behavio ral signs</a>
</div>
<a class="nav" href="neg.html" >neglect</a><br>
<div style="text-align: center;">
<a class="nav" href="obs_neg.h tml">observabl e signs</a><br>
</div>
<div style="text-align: center;">
<a class="nav" href="behav_neg .html">behavior al signs</a>
</div>
<a class="nav" href="sex.html" >sexual abuse</a><br>
<div style="text-align: center;">
<a class="nav" href="signs_sex .html">observab le signs</a><br>
</div>
<div style="text-align: center;">
<a class="nav" href="behav_sex .html">behavior al signs</a>
</div>
<a class="nav" href="emo.html" >emotional abuse</a><br>
<div style="text-align: center;">
<a class="nav" href="signs_emo .html">behavior al signs</a>
</div>
<a class="nav" href="rep1.html ">reporting </a><br>
<a class="nav" href="pro.html" >protecting</a><br>
<a class="nav" href="3rs.html" >the three R's</a><br>
<a class="nav" href="teach3rs. html">teaching three R's</a><br>
<a class="nav" href="rec.html" >recognize</a><br>
<a class="nav" href="res.html" >resist</a><br>
<a class="nav" href="rep.html" >report</a><br>
<a class="nav" href="rules.htm l">basic rules 1</a><br>
<a class="nav" href="rules2.ht ml">basic rules 2</a><br>
<a class="nav" href="law.html" >the law</a><br>
<a class="nav" href="concl.htm l">conclusio n</a><br>
<a class="nav" href="creds.htm l">credits</a><br>
<a class="nav" href="test.html ">self test</a><br>
</div>
<div id="Content">
<!-- content -->
<form onSubmit="formE val(this); return false;"
name="selfTest" action="">
<div style="font-weight: normal; font-size: 12pt">
<table width="100%" cellspacing="5p x">
<tr>
<td style="text-align: right; vertical-align: top"
width="10%">1.</td>
<td style="vertical-align: top" width="50%">
What are the 3 R's of child abuse prevention?
<span id="q1c" class="response " style="display: none;">
<br>Your answer is correct</span>
<span id="q1i" style="display: none;" class="response ">
<br>Your answer is incorrect</span>
<span id="q1s" style="display: none;" class="response ">
<ol>
<li>Recognize : acknowledge the problem.</li>
<li>Resist: resolve to take contrary action.</li>
<li>Report: inform the appropriate authorities.</li>
</ol>
</span>
</td>
<td style="vertical-align: top" width="40%">
<input type="radio" name="q1" value="i">relax ,
relegate, and regret<br>
<input type="radio" name="q1" value="i">retre at,
regroup, and revenge<br>
<input type="radio" name="q1" value="c">recog nize,
resist, and report<br>
<input type="radio" name="q1" value="i">revie w, reveal,
and relief<br>
</td>
</tr>
<tr>
<td colspan="3">&nb sp;<p></td>
</tr>
<tr>
<td style="text-align: right; vertical-align: top">2.</td>
<td style="vertical-align: top">
Child Abuse is most often committed by a
family member or someone who is known to the child.
<span id="q2c" style="display: none;" class="response ">
<br>Your answer is correct</span>
<span id="q2i" style="display: none;" class="response ">
<br>Your answer is incorrect</span>
<span id="q2s" style="display: none;" class="response ">
<br>Shocking, but sadly true.
</span>
</td>
<td style="vertical-align: top">
<input type="radio" name="q2" value="c">true
<input type="radio" name="q2" value="i">false
</td>
</tr>
<!-- *************** *************** *************** *****

I think you get the idea...

*************** *************** *************** ***** -->
<tr>
<td style="text-align: right;
vertical-align: top">10.</td>
<td style="vertical-align: top">
All citizens in Texas are required
by law to report child abuse.
<span id="q10c" style="display: none;" class="response ">
<br>Your answer is correct</span>
<span id="q10i" style="display: none;" class="response ">
<br>Your answer is incorrect</span>
<span id="q10s" style="display: none;" class="response ">
<br>All citizens <b>must</b> report child abuse by law.
</span>

</td>
<td style="vertical-align: top">
<input type="radio" name="q10" value="c">true
<input type="radio" name="q10" value="i">false
</td>
</tr>
<tr>
<td colspan="3" style="text-align: center">
<input type="submit" value="Score Self-test">
</td>
</tr>
</table>
</div>
</form>
<!-- /content -->
</div>
<div class="next"><a class="continue "
href="./index.html">hom e</a></div>
</body>
</html>
--
Rob
Jul 23 '05 #5
J.A.Rank wrote:
Hello all.
(snip)
Any suggestions are welcome.


OK. Had another whack at it. Still too lazy to do the ordered list.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet " href="parentEdS tyles.css" type="text/css">
<style type="text/css">

#Content {
border: 1px #000 solid;
padding: 10px 0;
background: #680000;
}
..answer {
display: none;
width: 90%;
font: normal 12px tahoma;
color: #fff;
padding: 5px;
margin: 2px;
border: 1px #fff solid;
background: #600;
}
..answer ol {
margin: 0;
}
..answer h5 {
font-size: 11px;
margin: 0 0 5px 0;
}
td {
vertical-align: top;
padding: 8px;
}
td.rtalign {
text-align: right;
vertical-align: top;
font-weight: 800;
}
input.sub {
font: normal 14px tahoma;
color: #fff;
margin-top: 24px;
background: #75202f;
}

</style>
<script type="text/javascript">

/*************** *************** *************** **/
var answers =
{

a1:

"<ol><li>Recogn ize: acknowledge the problem." +
"<li>Resist : resolve to take contrary action." +
"<li>Report : inform the appropriate authorities.</ol>"

,a2:

"Contrary to much popular belief, the person " +
"most likely to commit child abuse is a trusted " +
"member of the child's immediate family, " +
"or a friend or relative."

,a3:

"An abuser's fear of exposure is a powerful deterrent."

,a4:

"....someth ing here...."

,a5:

"....someth ing here...."

,a6:

"....someth ing here...."

,a7:

"....someth ing here...."

,a8:

"....someth ing here...."

,a9:

"....someth ing here...."

,a10:

"....someth ing here...."

}
/*************** *************** *************** **/

function getRadioValue(g rp)
{
var i = grp.length;
do
if (grp[--i].checked)
return grp[i].value;
while (i);
return null;
}

function grade(els)
{
var grp, val, msg, abox, n = 1;
while (grp = els['q' + n])
{
val = getRadioValue(g rp);
if (val == 'c')
msg = '<h5>Correct.</h5>' + answers['a' + n];
else if (!val)
msg = 'You did not answer the question.';
else msg = '<h5>Incorrect. </h5>' + answers['a' + n];
if (abox = document.getEle mentById('a' + n))
{
abox.innerHTML = msg;
abox.style.disp lay = 'block';
}
n++;
}
grade.s = setInterval('wi ndow.scrollBy(-30,-30)', 20);
setTimeout('cle arInterval(grad e.s)', 1000);
return false;
}

</script>
</head>
<body>
<div id="Menu">
<a class="nav" href="index.htm l">home</a><br>
<a class="nav" href="p2.html"> introduction</a><br>
<a class="nav" href="obj.html" >objectives</a><br>
<a class="nav" href="def.html" >definition</a><br>
<a class="nav" href="kinds.htm l">four kinds of abuse</a><br>
<a class="nav" href="signs.htm l">signs of abuse</a><br>
<a class="nav" href="phys.html ">physical abuse</a><br>
<div style="text-align: center;">
<a class="nav" href="obs_phys. html">observabl e signs</a>
</div>
<div style="text-align: center;">
<a class="nav" href="behav_phy s.html">behavio ral signs</a>
</div>
<a class="nav" href="neg.html" >neglect</a><br>
<div style="text-align: center;">
<a class="nav" href="obs_neg.h tml">observabl e signs</a><br>
</div>
<div style="text-align: center;">
<a class="nav" href="behav_neg .html">behavior al signs</a>
</div>
<a class="nav" href="sex.html" >sexual abuse</a><br>
<div style="text-align: center;">
<a class="nav" href="signs_sex .html">observab le signs</a><br>
</div>
<div style="text-align: center;">
<a class="nav" href="behav_sex .html">behavior al signs</a>
</div>
<a class="nav" href="emo.html" >emotional abuse</a><br>
<div style="text-align: center;">
<a class="nav" href="signs_emo .html">behavior al signs</a>
</div>
<a class="nav" href="rep1.html ">reporting </a><br>
<a class="nav" href="pro.html" >protecting</a><br>
<a class="nav" href="3rs.html" >the three R's</a><br>
<a class="nav" href="teach3rs. html">teaching three R's</a><br>
<a class="nav" href="rec.html" >recognize</a><br>
<a class="nav" href="res.html" >resist</a><br>
<a class="nav" href="rep.html" >report</a><br>
<a class="nav" href="rules.htm l">basic rules 1</a><br>
<a class="nav" href="rules2.ht ml">basic rules 2</a><br>
<a class="nav" href="law.html" >the law</a><br>
<a class="nav" href="concl.htm l">conclusio n</a><br>
<a class="nav" href="creds.htm l">credits</a><br>
<a class="nav" href="test.html ">self test</a><br>
</div>
<div id="Content">
<!-- content -->
<form name="selfTest" action="js_disa bled.php" method="post"
onsubmit="retur n grade(this.elem ents)">
<table width="100%" cellspacing="0" >
<tr>
<td class="rtalign" width="10%">1.</td>
<td width="50%" height="100%">
What are the 3 R's of child abuse prevention?
<div id="a1" class="answer"> </div>
</td>
<td width="40%">
<input id="q1a" name="q1" type="radio" value="i">
<label for="q1a">relax , relegate, and regret</label><br>
<input id="q1b" name="q1" type="radio" value="i">
<label for="q1b">retre at, regroup, and revenge</label><br>
<input id="q1c" name="q1" type="radio" value="c">
<label for="q1c">recog nize, resist, and report</label><br>
<input id="q1d" name="q1" type="radio" value="i">
<label for="q1d">revie w, reveal, and relief</label>
</td>
</tr><tr>
<td class="rtalign" >2.</td>
<td>
Child Abuse is most often committed by a family member or someone
who is known to the child.
<div id="a2" class="answer"> </div>
</td>
<td>
<input id="q2a" name="q2" type="radio" name="q2" value="c"><labe l
for="q2a">true</label>
<input id="q2b" name="q2" type="radio" name="q2" value="i"><labe l
for="q2b">false </label>
</td>
</tr><tr>
<td class="rtalign" >3.</td>
<td>
The best thing for any child to say to a person who is touching
them or talking to them in a wrong way is:
<div id="a3" class="answer"> </div>
</td>
<td>
<input id="q3a" name="q3" type="radio" value="i"><labe l for="q3a">What
are you doing?</label><br>
<input id="q3b" name="q3" type="radio" value="i"><labe l
for="q3b">Pleas e cut that
out.</label><br>
<input id="q3c" name="q3" type="radio" value="c"><labe l for="q3c">STOP!
I'M TELLING!</label><br>
</td>
</tr><tr>
<td class="rtalign" >4.</td>
<td>
Children may be afraid to tell about abuse because they may think
they are to blame.
<div id="a4" class="answer"> </div>
</td>
<td>
<input id="q4a" name="q4" type="radio" value="c"><labe l
for="q4a">true</label>
<input id="q4b" name="q4" type="radio" value="i"><labe l
for="q4b">false </label>
</td>
</tr><tr>
<td class="rtalign" >5.</td>
<td>
Abusers are easy to spot.They are poor and look frightening.
<div id="a5" class="answer"> </div>
</td>
<td>
<input id="q5a" name="q5" type="radio" value="i"><labe l
for="q5a">true</label>
<input id="q5b" name="q5" type="radio" value="c"><labe l
for="q5b">false </label>
</td>
</tr><tr>
<td class="rtalign" >6.</td>
<td>
Children have the right to:
<div id="a6" class="answer"> </div>
</td>
<td>
<input id="q6a" name="q6" type="radio" value="c"><labe l
for="q6a">refus e certain kinds of
contact</label><br>
<input id="q6b" name="q6" type="radio" value="i"><labe l
for="q6b">refus e any and all
contact</label><br>
<input id="q6c" name="q6" type="radio" value="i"><labe l
for="q6c">rejec t uncomfortable
authority</label><br>
<input id="q6d" name="q6" type="radio" value="i"><labe l
for="q6d">refus e guidance from
parents</label>
</td>
</tr><tr>
<td class="rtalign" >7.</td>
<td>
Talking about protection from child abusers is the job of school
teachers, not the job of parents.
<div id="a7" class="answer"> </div>
</td>
<td>
<input id="q7a" name="q7" type="radio" value="i"><labe l
for="q7a">true</label>
<input id="q7b" name="q7" type="radio" value="c"><labe l
for="q7b">false </label>
</td>
</tr><tr>
<td class="rtalign" >8.</td>
<td>
Select the rule that was NOT listed in the basic safety rules for
children.
<div id="a8" class="answer"> </div>
</td>
<td>
<input id="q8a" name="q8" type="radio" value="i"><labe l for="q8a">Never
hitchhike.</label><br>
<input id="q8b" name="q8" type="radio" value="i"><labe l
for="q8b">Alway s use the buddy
system.</label><br>
<input id="q8c" name="q8" type="radio" value="c"><labe l for="q8c">5
year-olds are in no
danger.</label>
</td>
</tr><tr>
<td class="rtalign" >9.</td>
<td>
If I believe that my child is being abused I can call
<div id="a9" class="answer"> </div>
</td>
<td>
<input id="q9a" name="q9" type="radio" value="i"><labe l for="q9a">my
child's friends</label><br>
<input id="q9b" name="q9" type="radio" value="i"><labe l for="q9b">the
suspected
abuser</label><br>
<input id="q9c" name="q9" type="radio" value="c"><labe l for="q9c">Child
Protective
Services</label><br>
<input id="q9d" name="q9" type="radio" value="c"><labe l for="q9d">the
police</label>
</td>
</tr><tr>
<td class="rtalign" >10.</td>
<td>
All citizens in Texas are required by law to report child abuse.
<div id="a10" class="answer"> </div>
</td>
<td>
<input id="q10a" name="q10" type="radio" value="c"><labe l
for="q10a">true </label>
<input id="q10b" name="q10" type="radio" value="i"><labe l
for="q10b">fals e</label>
</td>
</tr><tr>
<td colspan="3" style="text-align:center;">
<input class="sub" type="submit" value="Get answers"
onmouseover="th is.style.backgr ound='#900'"
onmouseout="thi s.style.backgro und='#75202f'">
</td>
</tr>
</table>
</form>
<!-- /content -->
</div>
<div class="next"><a class="continue "
href="./index.html">hom e</a></div>
</body>
</html>

Be sure to back this up at the server with remote grading.

Jul 23 '05 #6
RobG and RobB, thanks for all the good advice and guidance. Your
suggestions were all right on the money, and I thank you both for all
the time and attention you generously offered.

-Joe

J.A.Rank wrote:
Hello all.

I wrote a client-side form evaluation script that runs as expected in
Firefox, Netscape, and IE for PC, but fails in IE for Mac.

The formEval() method is called from the onSubmit event in the FORM
element, and on IE for Mac it shows the desired page for an instant and
then immediately reloads the form page. The pertinent code is:

<snip>

function formEval() {
var q1result = q1eval();
var q2result = q2eval();
var q3result = q3eval();
var q4result = q4eval();
var q5result = q5eval();
var q6result = q6eval();
var q7result = q7eval();
var q8result = q8eval();
var q9result = q9eval();
var q10result = q10eval();
document.close( );
document.open() ;
document.write(
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"\
"http://www.w3.org/TR/html4/loose.dtd">\
<html>\
<head>\
<link rel="stylesheet " href="parentEdS tyles.css"
type="text/css">\
</head>\
\
<body>\
<div id="Menu">\

<!-- ... -->

<tr>\
<td>&nbsp;</td>\
<td>' + q10result + '</td>\
</tr>\
</table>\
</div>\
</div>\
<div class="next"><a class="continue "
href="./index.html">hom e</a></div>\
</body>\
</html>'
);
document.close( );
}

</snip>

Everything is very straightforward (wrt the qNresult assignment), and
the full script can be seen at
http://www.rankfamily.com/joe/parentEd/test.html

Any suggestions are welcome.

Thanks,

Joe


Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
3803
by: Dave Rahardja | last post by:
Does the C++ standard specify the behavior of floating point numbers during "exceptional" (exceptional with respect to floating point numbers, not exceptions) conditions? For example: double a = 1.0 / 0.0; // What is the value of a? Infinity? double b = 0.0 / 0.0; // What is the value of b? NaN? What about overflow/underflow conditions in the library? Is HUGE_VAL always a
19
2579
by: E. Robert Tisdale | last post by:
In the context of the comp.lang.c newsgroup, the term "undefined behavior" actually refers to behavior not defined by the ANSI/ISO C 9 standard. Specifically, it is *not* true that "anything can happen" if your C code invokes "undefined behavior". Behavior not defined by the ANSI/ISO C 9 standard may be defined by some other standard (i.e. POSIX) or it may be defined by your compiler, your operating system or your machine architecture.
23
3209
by: Ken Turkowski | last post by:
The construct (void*)(((long)ptr + 3) & ~3) worked well until now to enforce alignment of the pointer to long boundaries. However, now VC++ warns about it, undoubtedly to help things work on 64 bit machines, i.e. with 64 bit pointers. In the early days of C, where there were problems with the size of int being 16 or 32 bits, the response was that an int was guaranteed to hold a pointer (yes, there were 64Kb address spaces at one time!)....
38
2105
by: Steven Bethard | last post by:
> >>> aList = > >>> it = iter(aList) > >>> zip(it, it) > > That behavior is currently an accident. >http://sourceforge.net/tracker/?group_id=5470&atid=105470&func=detail&aid=1121416
7
22491
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We added an entry to the executable's .exe.config file to specify the URL, and under the 1.1 framework this worked well. Unfortunately, this is not working under the 2.0 framework. I see in the Reference.cs file under the web service reference the...
66
3123
by: gyan | last post by:
Hi All, I am using sprintf and getting starnge output in following case char temp_rn; memset(temp_rn,'\0',12); sprintf(temp_rn,"0%s",temp_rn); the final value in temp_rn is 00 how it is behaving like this, when source string and output string is
12
3062
by: Rajesh S R | last post by:
Can anyone tell me what is the difference between undefined behavior and unspecified behavior? Though I've read what is given about them, in ISO standards, I'm still not able to get the difference. For example: Consider the following code: a = i; We say that the above expression statement produces undefined
28
2547
by: v4vijayakumar | last post by:
#include <string> #include <iostream> using namespace std; int main() { string str; str.resize(5); str = 't';
35
2242
by: bukzor | last post by:
I've found some bizzare behavior when using mutable values (lists, dicts, etc) as the default argument of a function. I want to get the community's feedback on this. It's easiest to explain with code. This example is trivial and has design issues, but it demonstrates a problem I've seen in production systems: def main(argv = ): 'print out arguments with BEGIN and END' argv.insert(1, "BEGIN")
33
2841
by: coolguyaroundyou | last post by:
Will the following statement invoke undefined behavior : a^=b,b^=a,a^=b ; given that a and b are of int-type ?? Be cautious, I have not written a^=b^=a^=b ; which, of course, is undefined. I am having some confusion with the former statement! Also, state the reason for the statement being undefined!
0
8989
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9537
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9367
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9243
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8241
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4599
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3309
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2213
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.