PDA

View Full Version : Select Box and click()


lord_raven
08-15-2003, 08:18 PM
Is there a way to simulate a mouse click in a select box? I know it can be done to buttons, radios, and checkboxes by adding formname.elementname.click(), but that doesn't work in select boxes... I want to make the select box automatically drop down when moused over... no reason in particular, I'm just experimenting...

I get this error...

Event thread: onmouseover
Error:
name: TypeError
message: Statement on line 1: Expression did not evaluate to a function object: form.select2.click
Backtrace:
In unknown script
form.select2.click();
At unknown location
{event handler trampoline}

beetle
08-15-2003, 08:42 PM
The click() method doesn't make the dropdown expand anyways. This simple test proves that<select onmouseover="this.click()" onclick="alert('click')">
<option>blah</option>
</select>Is that an Opera error message?

lord_raven
08-15-2003, 08:55 PM
Originally posted by beetle
The click() method doesn't make the dropdown expand anyways.
Is that an Opera error message? I believe I said that in my post... I'm looking for an alternate method...

and, yes, that is an Opera error message...

beetle
08-15-2003, 09:21 PM
There is no other way.

Spookster
08-15-2003, 09:31 PM
lord_raven, your signature is in violation of our forum rule 2.1 regarding signatures being 4 lines or less.

http://www.codingforums.com/rules.htm

Please correct that.

lord_raven
08-16-2003, 02:13 AM
*goes to fix it*