Welcome to WebmasterWorld Guest from 54.162.168.187

Forum Moderators: open

Message Too Old, No Replies

radio buttons not working in chrome or firefox

     
3:59 pm on Jul 26, 2011 (gmt 0)

New User

5+ Year Member

joined:July 26, 2011
posts: 1
votes: 0


On loading the page the radio buttons are checked and filled by a conditional statement. This works fine in IE but not chrome or Firefox... I have put the conditional code in bold

Can anyone tell me why please?

<tr><td colspan="3" height="100%"><div style="width:100%; height:100%;overflow: auto;border:solid 1px #0096ff;background-color:white;">
<input type="hidden" name="text277" id="id277" useoptrb="2" value="Test">
<input type="hidden" name="text405" id="id405" useoptrb="2" value="Test2">
<input type="hidden" name="text393" id="id393" useoptrb="1" value="">
<input type="hidden" name="text269" id="id269" useoptrb="1" value="">
<input type="hidden" name="text270" id="id270" useoptrb="1" value="">
<input type="hidden" name="text406" id="id406" useoptrb="1" value="">
<input type="hidden" name="text279" id="id279" useoptrb="1" value="">
<input type="hidden" name="text281" id="id281" useoptrb="1" value="">
<input type="hidden" name="text278" id="id278" useoptrb="1" value="">
<input type="hidden" name="text271" id="id271" useoptrb="1" value="">
<input type="hidden" name="text276" id="id276" useoptrb="1" value="">
<input type="hidden" name="text275" id="id275" useoptrb="1" value="">
<input type="hidden" name="text272" id="id272" useoptrb="1" value="">

<script>
function addel(ob) {
arySubSection[arySubSection.length] = ob;
}

addel(["277", "Site Management", "YOUR COMPANY NAME is required ."]);
addel(["405", "Selection of Contractors", "Domestic contractors are."]);
addel(["393", "Site Rules", "The following rules will apply."]);
addel(["269", "Training", "YOUR COMPANY NAME will ens."]);
addel(["270", "Documentation", "Every Contractor shall provide ."]);
addel(["406", "Communications", "The y."]);
addel(["279", "Control of Access", "YOUR COMPANY NAME ."]);
addel(["281", "Site Fencing", "Fencing will be ."]);
addel(["278", "Hoarding", "All timber hoardings w."]);
addel(["271", "Information and Signs", "A Health and Saf."]);
addel(["276", "P.P.E.", "The site will be des."]);
addel(["275", "Noise", "YOUR COMPANY NAME will continually ."]);
addel(["272", "Dust and Mud", "If in periods of dry ."]);


for (var ii=0; ii<arySubSection.length; ii++) {
subid = arySubSection[ii][0];
document.write('<table width="100%" cellspacing="0"><tr>');
document.write('<td width="100%"><h3 class="mssubsectiontitle" name="title' + subid + '" id="title' + subid + '"><a href="javascript:edit(' + ii + ');" class="mssubsectiontitle">' + arySubSection[ii][1] + '</a></h3></td>');
document.write('<td nowrap>');
document.write(' <input type="radio" name="useopt' + subid + '" value=1 ' + (eval('document.forms.mspage.text' + subid + '.useoptrb == 1 ? checked="checked" : " " ')) + ' onclick="useoptClick();" style="background-color:#0096ff;"> Default');
document.write(' <input type="radio" name="useopt' + subid + '" value=2 ' + (eval('document.forms.mspage.text' + subid + '.useoptrb == 2 ? checked="checked" : " " ')) + ' onclick="useoptClick();" style="background-color:#ccffbb;"> Own');
document.write(' <input type="radio" name="useopt' + subid + '" value=0 ' + (eval('document.forms.mspage.text' + subid + '.useoptrb == 0 ? checked="checked" : " " ')) + ' onclick="useoptClick();" style="background-color:#D6D6D6;"> Exclude');

document.write('</td></tr></table>');
document.write('<div class="sectiontext" name="txt' + subid + '" id="txt' + subid + '" onclick="edit(' + ii + ');">' + strDefaultText + '</div>');
document.write('<br>');
}

function writeTxt() {
for (var ii=0; ii<arySubSection.length; ii++) {
subid = arySubSection[ii][0];
var df = document.forms.mspage;
try {
if (eval('document.forms.mspage.useopt' + subid + '[1].checked')) {
txt = eval('df.text' + subid + '.value');
eval('document.all.txt' + subid + (txt==''? '.innerHTML = strDefaultText' : '.innerText = txt'));
} else if (eval('document.forms.mspage.useopt' + subid + '[2].checked')) {
eval('document.all.txt' + subid + '.innerHTML = strDefaultText2');
} else {
eval('document.all.txt' + subid + '.innerText = arySubSection[ii][2]');
}
}
catch (e) { alert(e.description); }
}
}
writeTxt();
4:24 pm on July 26, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 17, 2005
posts:4996
votes: 14


I would start by opening Firebug and adding a breakpoint on those lines and inspecting all of the values to see if they match what you think they should be.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members