[thelist] [help] image connected to a submit function w/ javascript embedded

aardvark roselli at earthlink.net
Mon Nov 13 23:57:53 CST 2000


> From: Jason Fields <jason at v1c.net>
[...]
> where it stands now... if i add the graphic image and reference it properly
> as noted in all of the html resources online... see below...
> 
> <input type="image" src="button.gif" height="11" width="123">
> 
> upon clicking the button... submission of the form the results sent back are
> ONLY the coordinates of where I clicked the button graphic (ie. form.x: 44
> form.y: 2)... and not the contents of the form itself (ie. name: john doe,
> email: john at doe.com, company: acme identities, comments: none )...

are you sure that your submit is in the right form?  did you change 
the form method to get to see what's appended to the URL? do you 
have a sample page posted anywhere?

to date, i have not had any problems among the major browsers 
(and almost all minor browsers) using image submits... i'd check 
the code for errors, first...

> upon further research I found that if I trigger the form submission using an
> href with javascript... as in the code below...
> 
> <a href="javascript:document.myform.submit()">
> <img src="button.gif" height="11" width="123">
> </a>
> 
> the code in the action statement will not work...

well, no, you shouldn't use a JS submit routine without a darn good 
reason... i can't address why the onsubmit JS isn't firing, but i 
wouldn't be surprised if fixing one problem fixes the other...

again, code or a URL would be handy (URL preferred, since i hate 
20k messages, and so do our digesters)....

> sooo... i am stuck... any ideas, suggestions, examples, links, etc would be
> very helpful...the ultimate goal is to have the form results posted in a new
> pop window once the user clicks on the submit button graphic...

oh, well have you tried adding a target to your form tag?

as for pages with image submits, lemme pull one from my kiester 
here... http://herdaboutbuffalo.com/merchandise/ ... add a product 
to the cart... every button in the cart is an image... i have a few 
others, but now i'm getting lazy...

> btw... the i dont know perl well enough to modify the cgi to accommodate for
> any of this... my knowledge is just enough to be dangerous behind the
> wheel... but not enough to dodge pedestrians if the brakes go out...

um... so how are you capturing the data?  and what are you doing 
with it besides writing it to the screen?




More information about the thelist mailing list