I define a function that is executed on the image's onClick event. In that
function I set the action, then execute the form's submit.
Example (with spaces added after each "<" to avoid trouble with email
readers.):
< form name="myForm" action="">
< img src="mySubmitImage.gif" onClick="submitForm();">
< /form>
< script>
function submitForm() {
var submitted=false;
if (!submitted) {
submitted=true;
document.myForm.action="myTargetForm.asp";
document.myForm.submit();
}
}
< /script>
HTH,
Robert
> -----Original Message-----
> From: macmec [mailto:email@hidden]
> Sent: Thursday, June 24, 2004 3:39 PM
> To: email@hidden
> Subject: Graphic Submit Button
>
>
> Hey all,
>
> I'm working with PHP, making a shopping cart/store and I'm curious if
> there's a good way to use graphic buttons to accomplish the
> same thing
> as the submit button. Since the input type becomes image, I could
> check for that in my PHP script, but the problem is, some of
> the forms
> have multiple buttons, so there would be more than one input
> with type
> image. I'm not sure if there's another way to go about submitting a
> form (via POST) to accomplish this. Any thoughts would be very
> appreciated.
>
> macmec ~ email@hidden
> This message was sent from an Apple PowerBook G4. Epitome of
> creativity.
> _______________________________________________
> web-development mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/web-development
> Do not post admin requests to the list. They will be ignored.
>
CONFIDENTIALITY NOTICE: This e-mail transmission, and any documents, files,
or other e-mail messages attached to it, may contain confidential
information that is legally privileged. If you are not the intended
recipient, or a person responsible for delivering it to the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or use of any of the information contained in or attached to
this message is STRICTLY PROHIBITED. If you have received this transmission
in error, please immediately notify the sender via e-mail or by telephone at
615.320.0055 and destroy the original transmission and its attachments
without reading them or saving them to disk. Thank you
_______________________________________________
web-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/web-development
Do not post admin requests to the list. They will be ignored.