onClick submit FORM

Javascript coding ..

Moderators: macek, egami, gesf

patna_in
New php-forum User
New php-forum User
Posts: 103
Joined: Sun Feb 06, 2005 10:54 am
Contact:

onClick submit FORM

Postby patna_in » Thu Oct 13, 2005 11:19 am

Hi, I'm using image as a Submit Button so I need to use a JavaScript function. But I don't know how to submit the FORM using Java Script. Plz help ...

User avatar
gesf
Moderator
Moderator
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Postby gesf » Sat Oct 15, 2005 1:22 am

Add this to your input: onclick="this.submit();"

patna_in
New php-forum User
New php-forum User
Posts: 103
Joined: Sun Feb 06, 2005 10:54 am
Contact:

Postby patna_in » Mon Oct 17, 2005 5:35 am

Thanks for reply

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Mon Oct 17, 2005 7:10 am

Hi, I'm using image as a Submit Button so I need to use a JavaScript function. But I don't know how to submit the FORM using Java Script. Plz help ...


Ähh.. guys... i think you forgot about <input type="image" src="" />
That will work as a submit button inside the form...

User avatar
gesf
Moderator
Moderator
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Postby gesf » Mon Oct 17, 2005 7:57 am

patna_in wrote:Hi, I'm using image as a Submit Button ...
I guess he already know that part... do ya patna_in !? :)

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Mon Oct 17, 2005 8:02 am

seems to me that no as the question states that javascript is needed due to the usage of image.. this logicaly leads us to the next part: JS not needed when using a submit type button... :)

patna_in
New php-forum User
New php-forum User
Posts: 103
Joined: Sun Feb 06, 2005 10:54 am
Contact:

Postby patna_in » Thu Oct 20, 2005 8:50 am

Thanks alexi & sorry to gesf. I'm not aware of that...

User avatar
gesf
Moderator
Moderator
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Postby gesf » Thu Oct 20, 2005 9:01 am

:D

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Thu Oct 20, 2005 9:13 am

I will quote gesf on this matter:

:D

sanketce
New php-forum User
New php-forum User
Posts: 90
Joined: Fri Dec 02, 2005 3:23 am

Postby sanketce » Fri Dec 02, 2005 3:38 am

One solution is here,

you can set your html code like this:

<input src="images/img1.jpg" type="image" name="SUBMIT" >

now your image acts as submit button and onsubmit you can call javascript function.


All the best........

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Fri Dec 02, 2005 11:15 am

well..i have already posted that.. and the JS is not needed for submitting ;)
But yeah..


Return to “JavaScript”

Who is online

Users browsing this forum: No registered users and 1 guest

cron