Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting coordinate from input type=image

Status
Not open for further replies.

TAMSIN

Programmer
Sep 6, 2000
31
0
0
GB
Hi,

I know that an input type=image passes the x & y coordinates rather than the name & value, but I can't work out how to get these values. I've written the following (much simplified from what I really want to do!) which I call from an onSubmit trigger on the form:

function checkButton(frm, inp) {
btn = inp + ".x";
alert(frm[btn].x);
}

but the alert just shows "undefined". inp is the name of the input and frm is a reference to the form, I know this works as I can modify it to get values from text boxes etc. I've also tried frm.inp.value but it doesn't like that either. Any clues?
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top