/    Sign up×
Community /Pin to ProfileBookmark

Script donot work in mozilla

The followinf script works very well in IE but fails to work in FireFox
this is scaled down version of the code. i get error as mentioned below

<INPUT onclick=”formdisable(document.top, document.bottom,0)”
type=radio value=1 name=RADIO>click here to see </INPUT>

<INPUT type=radio CHECKED value=2 name=RADIO onfocus=check_option(1,document.top.SELNAME,2)
onclick=”formdisable(document.bottom, document.top,0)”></INPUT>

function formdisable(formname,disabled_form,my_val)
{

if(my_val == 0)
{
if(RADIO[0].checked)
{
alert(“Hi”)

}

}

}

Error: RADIO is not defined
Source File: file:///C:/Documents%20and%20Setting/Report.htm
Line: 626

Plz help me with this thank you .

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@nitro2k01Oct 10.2006 — What you're doing wrong is that you try to access a DOM item with its literal name in code, which is non-standard. Try using for example [b]document.getElementsByName[/b]. Example:var radioarray = document.getElementsByName("RADIO");

if(radioarray[0].checked)
{
alert("Hi");
}
Copy linkTweet thisAlerts:
@nithin16184authorOct 10.2006 — Thanks a lot its working ?
×

Success!

Help @nithin16184 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...