Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   Submit Form by clicking on an image (http://www.velocityreviews.com/forums/t795526-submit-form-by-clicking-on-an-image.html)

Ice Man 07-22-2004 12:04 PM

Submit Form by clicking on an image
 
Hi all

How Can I submit a form by clicking on an image instead of the submit
button?

Thanks



Elie Grouchko 07-22-2004 12:39 PM

Re: Submit Form by clicking on an image
 
Use JavaScript code that will submit the form as a result of the click
event:

<html>
<head>

<script type="text/javascript">
function SubmitForm()
{
document.getElementById("form1").submit();
}
</script>

</head>
<body>

<form id="form1" action="page2.htm" method="post">

<img src="" onclick="SubmitForm()">

</form>

</body>


"Ice Man" <ehc00@hotmail.com> wrote in message
news:%23o5Enu9bEHA.4032@TK2MSFTNGP11.phx.gbl...
> Hi all
>
> How Can I submit a form by clicking on an image instead of the submit
> button?
>
> Thanks
>
>




Stuart Palmer 07-23-2004 07:24 AM

Re: Submit Form by clicking on an image
 

"Elie Grouchko" <egrouchko@hotmail.com> wrote in message
news:OIAKNl%23bEHA.2972@TK2MSFTNGP12.phx.gbl...
> Use JavaScript code that will submit the form as a result of the click
> event:
>
> <html>
> <head>
>
> <script type="text/javascript">
> function SubmitForm()
> {
> document.getElementById("form1").submit();
> }
> </script>
>
> </head>
> <body>
>
> <form id="form1" action="page2.htm" method="post">
>
> <img src="" onclick="SubmitForm()">
>
> </form>
>
> </body>
>


Why don't you just use:

<input type="image" src="image.jpg" alt="Submit" height="50" width="50" />

Then the form will submit for JS user and non JS users alike.....BTW, how
long has ASP been clientsize javascript?

:o/

>
> "Ice Man" <ehc00@hotmail.com> wrote in message
> news:%23o5Enu9bEHA.4032@TK2MSFTNGP11.phx.gbl...
> > Hi all
> >
> > How Can I submit a form by clicking on an image instead of the submit
> > button?
> >
> > Thanks
> >
> >

>
>




Ice Man 07-23-2004 03:25 PM

Re: Submit Form by clicking on an image
 
I don't know actually how long but it helps a lot...


"Stuart Palmer" <stuartglenpalmer@ntlworld.com> wrote in message
news:833Mc.334$ub4.268@newsfe5-gui.ntli.net...
>
> "Elie Grouchko" <egrouchko@hotmail.com> wrote in message
> news:OIAKNl%23bEHA.2972@TK2MSFTNGP12.phx.gbl...
> > Use JavaScript code that will submit the form as a result of the click
> > event:
> >
> > <html>
> > <head>
> >
> > <script type="text/javascript">
> > function SubmitForm()
> > {
> > document.getElementById("form1").submit();
> > }
> > </script>
> >
> > </head>
> > <body>
> >
> > <form id="form1" action="page2.htm" method="post">
> >
> > <img src="" onclick="SubmitForm()">
> >
> > </form>
> >
> > </body>
> >

>
> Why don't you just use:
>
> <input type="image" src="image.jpg" alt="Submit" height="50" width="50" />
>
> Then the form will submit for JS user and non JS users alike.....BTW, how
> long has ASP been clientsize javascript?
>
> :o/
>
> >
> > "Ice Man" <ehc00@hotmail.com> wrote in message
> > news:%23o5Enu9bEHA.4032@TK2MSFTNGP11.phx.gbl...
> > > Hi all
> > >
> > > How Can I submit a form by clicking on an image instead of the submit
> > > button?
> > >
> > > Thanks
> > >
> > >

> >
> >

>
>




Bã§TãRÐ 07-27-2004 04:27 AM

Re: Submit Form by clicking on an image
 
The image actually works like a submit button when using

<input type="image" name="subButton" src="image.jpg" alt="Submit"
height="50" width="50" />

getting the value from the submit button is
request.form("subButton.x") OR
request.form("subButton.y")

Because the button is an image - you are esentially testing to see if
the x,y value (height, width) is greater than 0

Hope this help
- Bastard


On Fri, 23 Jul 2004 17:25:24 +0200, "Ice Man" <ehc00@hotmail.com>
wrote:

>I don't know actually how long but it helps a lot...
>
>
>"Stuart Palmer" <stuartglenpalmer@ntlworld.com> wrote in message
>news:833Mc.334$ub4.268@newsfe5-gui.ntli.net...
>>
>> "Elie Grouchko" <egrouchko@hotmail.com> wrote in message
>> news:OIAKNl%23bEHA.2972@TK2MSFTNGP12.phx.gbl...
>> > Use JavaScript code that will submit the form as a result of the click
>> > event:
>> >
>> > <html>
>> > <head>
>> >
>> > <script type="text/javascript">
>> > function SubmitForm()
>> > {
>> > document.getElementById("form1").submit();
>> > }
>> > </script>
>> >
>> > </head>
>> > <body>
>> >
>> > <form id="form1" action="page2.htm" method="post">
>> >
>> > <img src="" onclick="SubmitForm()">
>> >
>> > </form>
>> >
>> > </body>
>> >

>>
>> Why don't you just use:
>>
>> <input type="image" src="image.jpg" alt="Submit" height="50" width="50" />
>>
>> Then the form will submit for JS user and non JS users alike.....BTW, how
>> long has ASP been clientsize javascript?
>>
>> :o/
>>
>> >
>> > "Ice Man" <ehc00@hotmail.com> wrote in message
>> > news:%23o5Enu9bEHA.4032@TK2MSFTNGP11.phx.gbl...
>> > > Hi all
>> > >
>> > > How Can I submit a form by clicking on an image instead of the submit
>> > > button?
>> > >
>> > > Thanks
>> > >
>> > >
>> >
>> >

>>
>>

>




All times are GMT. The time now is 05:34 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57