By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,566 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,566 IT Pros & Developers. It's quick & easy.

click() question

P: n/a

I want to programatically force click a certain radio button named
"fourdp".

A click(fourdp) ; returns an undefined error.
What am I doing wrong?
--
Many thanks,

Don Lancaster
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
voice: (928)428-4073 email: do*@tinaja.com fax 847-574-1462

Please visit my GURU's LAIR web site at http://www.tinaja.com

Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
> I want to programatically force click a certain radio button named
"fourdp".

A click(fourdp) ; returns an undefined error.
What am I doing wrong?


html objects are in a distinct space from JavaScript objects. You have to use an
accessor method like

document.getElementById('fourdp').click();

where fourdp is the id (not necessarily the name) of the element.

More hints here: http://www.crockford.com/#javascript

Jul 20 '05 #2

P: n/a
Douglas Crockford wrote:
I want to programatically force click a certain radio button named
"fourdp".

A click(fourdp) ; returns an undefined error.
What am I doing wrong?


html objects are in a distinct space from JavaScript objects. You have to use an
accessor method like

document.getElementById('fourdp').click();

where fourdp is the id (not necessarily the name) of the element.

More hints here: http://www.crockford.com/#javascript


If I try adding an ID="fourdp" etc to the radio buttons, the return
error message is

OBJECT DOESN'T SUPPORT THIS PROPERTY OR METHOD.

Can a radio button have an ID?
--
Many thanks,

Don Lancaster
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
voice: (928)428-4073 email: do*@tinaja.com fax 847-574-1462

Please visit my GURU's LAIR web site at http://www.tinaja.com

Jul 20 '05 #3

P: n/a
> > > I want to programatically force click a certain radio button named
"fourdp".

A click(fourdp) ; returns an undefined error.
What am I doing wrong?


html objects are in a distinct space from JavaScript objects. You have to use an accessor method like

document.getElementById('fourdp').click();

where fourdp is the id (not necessarily the name) of the element.

More hints here: http://www.crockford.com/#javascript


If I try adding an ID="fourdp" etc to the radio buttons, the return
error message is

OBJECT DOESN'T SUPPORT THIS PROPERTY OR METHOD.

Can a radio button have an ID?


Sure they can. Make sure they each have a different id.

Jul 20 '05 #4

P: n/a
Douglas Crockford wrote:
> I want to programatically force click a certain radio button named
> "fourdp".
>
> A click(fourdp) ; returns an undefined error.
> What am I doing wrong?

html objects are in a distinct space from JavaScript objects. You have to use an accessor method like

document.getElementById('fourdp').click();

where fourdp is the id (not necessarily the name) of the element.

More hints here: http://www.crockford.com/#javascript


If I try adding an ID="fourdp" etc to the radio buttons, the return
error message is

OBJECT DOESN'T SUPPORT THIS PROPERTY OR METHOD.

Can a radio button have an ID?


Sure they can. Make sure they each have a different id.


Finally worked it out.

form.hominydp.fourdp.click() ;

apparently works properly
--
Many thanks,

Don Lancaster
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
voice: (928)428-4073 email: do*@tinaja.com fax 847-574-1462

Please visit my GURU's LAIR web site at http://www.tinaja.com

Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.