473,386 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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="parentEdStyles.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">home</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 1429
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="formEval(); 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="parentEdStyles.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">home</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="parentEdStyles.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>Recognize: 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(grp)
{
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(grp);
if (val == 'c')
msg = 'Correct.<br><br>' + answers['a' + n];
else if (!val)
msg = 'You did not answer the question.';
else msg = 'Incorrect.<br><br>' + answers['a' + n];
if (ans = document.getElementById('a' + n))
{
ans.innerHTML = msg;
ans.style.display = 'block';
}
n++;
}
window.scrollTo(0,0);
}

</script>
<div id="Menu">
<a class="nav" href="index.html">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.html">four kinds of abuse</a><br>
<a class="nav" href="signs.html">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">observable signs</a>
</div>
<div style="text-align: center;">
<a class="nav" href="behav_phys.html">behavioral signs</a>
</div>
<a class="nav" href="neg.html">neglect</a><br>
<div style="text-align: center;">
<a class="nav" href="obs_neg.html">observable signs</a><br>
</div>
<div style="text-align: center;">
<a class="nav" href="behav_neg.html">behavioral 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">observable signs</a><br>
</div>
<div style="text-align: center;">
<a class="nav" href="behav_sex.html">behavioral 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">behavioral 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.html">basic rules 1</a><br>
<a class="nav" href="rules2.html">basic rules 2</a><br>
<a class="nav" href="law.html">the law</a><br>
<a class="nav" href="concl.html">conclusion</a><br>
<a class="nav" href="creds.html">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">retreat, regroup, and
revenge</input><br>
<input type="radio" name="q1" value="c">recognize, resist, and
report</input><br>
<input type="radio" name="q1" value="i">review, 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">Please 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">refuse certain kinds of
contact</input><br>
<input type="radio" name="q6" value="i">refuse any and all
contact</input><br>
<input type="radio" name="q6" value="i">reject uncomfortable
authority</input><br>
<input type="radio" name="q6" value="i">refuse 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">Always 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">home</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="parentEdStyles.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.getElementById('q' + i + 'c').style.display='';
document.getElementById('q' + i + 'i').style.display='none';

// In all other cases
} else {
document.getElementById('q' + i + 'c').style.display='none';
document.getElementById('q' + i + 'i').style.display='';
}

// Show the response statement
document.getElementById('q' + i + 's').style.display='';
}
}
}

// 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.html">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.html">four kinds of abuse</a><br>
<a class="nav" href="signs.html">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">observable signs</a>
</div>
<div style="text-align: center;">
<a class="nav" href="behav_phys.html">behavioral signs</a>
</div>
<a class="nav" href="neg.html">neglect</a><br>
<div style="text-align: center;">
<a class="nav" href="obs_neg.html">observable signs</a><br>
</div>
<div style="text-align: center;">
<a class="nav" href="behav_neg.html">behavioral 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">observable signs</a><br>
</div>
<div style="text-align: center;">
<a class="nav" href="behav_sex.html">behavioral 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">behavioral 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.html">basic rules 1</a><br>
<a class="nav" href="rules2.html">basic rules 2</a><br>
<a class="nav" href="law.html">the law</a><br>
<a class="nav" href="concl.html">conclusion</a><br>
<a class="nav" href="creds.html">credits</a><br>
<a class="nav" href="test.html">self test</a><br>
</div>
<div id="Content">
<!-- content -->
<form onSubmit="formEval(this); return false;"
name="selfTest" action="">
<div style="font-weight: normal; font-size: 12pt">
<table width="100%" cellspacing="5px">
<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">retreat,
regroup, and revenge<br>
<input type="radio" name="q1" value="c">recognize,
resist, and report<br>
<input type="radio" name="q1" value="i">review, reveal,
and relief<br>
</td>
</tr>
<tr>
<td colspan="3">&nbsp;<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">home</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="parentEdStyles.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>Recognize: 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:

"....something here...."

,a5:

"....something here...."

,a6:

"....something here...."

,a7:

"....something here...."

,a8:

"....something here...."

,a9:

"....something here...."

,a10:

"....something here...."

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

function getRadioValue(grp)
{
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(grp);
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.getElementById('a' + n))
{
abox.innerHTML = msg;
abox.style.display = 'block';
}
n++;
}
grade.s = setInterval('window.scrollBy(-30,-30)', 20);
setTimeout('clearInterval(grade.s)', 1000);
return false;
}

</script>
</head>
<body>
<div id="Menu">
<a class="nav" href="index.html">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.html">four kinds of abuse</a><br>
<a class="nav" href="signs.html">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">observable signs</a>
</div>
<div style="text-align: center;">
<a class="nav" href="behav_phys.html">behavioral signs</a>
</div>
<a class="nav" href="neg.html">neglect</a><br>
<div style="text-align: center;">
<a class="nav" href="obs_neg.html">observable signs</a><br>
</div>
<div style="text-align: center;">
<a class="nav" href="behav_neg.html">behavioral 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">observable signs</a><br>
</div>
<div style="text-align: center;">
<a class="nav" href="behav_sex.html">behavioral 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">behavioral 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.html">basic rules 1</a><br>
<a class="nav" href="rules2.html">basic rules 2</a><br>
<a class="nav" href="law.html">the law</a><br>
<a class="nav" href="concl.html">conclusion</a><br>
<a class="nav" href="creds.html">credits</a><br>
<a class="nav" href="test.html">self test</a><br>
</div>
<div id="Content">
<!-- content -->
<form name="selfTest" action="js_disabled.php" method="post"
onsubmit="return grade(this.elements)">
<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">retreat, regroup, and revenge</label><br>
<input id="q1c" name="q1" type="radio" value="c">
<label for="q1c">recognize, resist, and report</label><br>
<input id="q1d" name="q1" type="radio" value="i">
<label for="q1d">review, 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"><label
for="q2a">true</label>
<input id="q2b" name="q2" type="radio" name="q2" value="i"><label
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"><label for="q3a">What
are you doing?</label><br>
<input id="q3b" name="q3" type="radio" value="i"><label
for="q3b">Please cut that
out.</label><br>
<input id="q3c" name="q3" type="radio" value="c"><label 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"><label
for="q4a">true</label>
<input id="q4b" name="q4" type="radio" value="i"><label
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"><label
for="q5a">true</label>
<input id="q5b" name="q5" type="radio" value="c"><label
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"><label
for="q6a">refuse certain kinds of
contact</label><br>
<input id="q6b" name="q6" type="radio" value="i"><label
for="q6b">refuse any and all
contact</label><br>
<input id="q6c" name="q6" type="radio" value="i"><label
for="q6c">reject uncomfortable
authority</label><br>
<input id="q6d" name="q6" type="radio" value="i"><label
for="q6d">refuse 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"><label
for="q7a">true</label>
<input id="q7b" name="q7" type="radio" value="c"><label
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"><label for="q8a">Never
hitchhike.</label><br>
<input id="q8b" name="q8" type="radio" value="i"><label
for="q8b">Always use the buddy
system.</label><br>
<input id="q8c" name="q8" type="radio" value="c"><label 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"><label for="q9a">my
child's friends</label><br>
<input id="q9b" name="q9" type="radio" value="i"><label for="q9b">the
suspected
abuser</label><br>
<input id="q9c" name="q9" type="radio" value="c"><label for="q9c">Child
Protective
Services</label><br>
<input id="q9d" name="q9" type="radio" value="c"><label 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"><label
for="q10a">true</label>
<input id="q10b" name="q10" type="radio" value="i"><label
for="q10b">false</label>
</td>
</tr><tr>
<td colspan="3" style="text-align:center;">
<input class="sub" type="submit" value="Get answers"
onmouseover="this.style.background='#900'"
onmouseout="this.style.background='#75202f'">
</td>
</tr>
</table>
</form>
<!-- /content -->
</div>
<div class="next"><a class="continue"
href="./index.html">home</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="parentEdStyles.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">home</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
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...
19
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...
23
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...
38
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
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...
66
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...
12
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...
28
by: v4vijayakumar | last post by:
#include <string> #include <iostream> using namespace std; int main() { string str; str.resize(5); str = 't';
35
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...
33
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....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.