img: on click select

D

Dooing

Hi,

I want to combine an image with an on click event like:

onclick="document.myForm.myValue.focus();document.myForm.myValue.focus.select();"

With a simple img, it didn't work - when using an image button, it does
work,
but then the form also gets submitted (what I don't want to..)

Any ideas of how to achieve this?
 
E

Evertjan.

wrote on 07 jun 2006 in comp.lang.javascript:
I want to combine an image with an on click event like:

onclick="document.myForm.myValue.focus();document.myForm.myValue.focus.
select();"

What would be the HTML purpose of selecting an <img>?

What would be the HTML purpose of selecting an object's focus?
With a simple img, it didn't work - when using an image button, it
does work,

What is "work" here?
but then the form also gets submitted (what I don't want to..)

Then do not put it in a form, or do an onsubmit='return false;'
Any ideas of how to achieve this?

What? The select?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top