Board index   FAQ   Search  
Register  Login
Board index php forum :: HTML JavaScript

onClick submit FORM

Javascript coding ..

Moderators: macek, egami, gesf

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 ...
patna_in
New php-forum User
New php-forum User
 
Posts: 103
Joined: Sun Feb 06, 2005 10:54 am

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

Add this to your input: onclick="this.submit();"
User avatar
gesf
Moderator
Moderator
 
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden

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

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

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
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

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
gesf
Moderator
Moderator
 
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden

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... :)
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

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

Thanks alexi & sorry to gesf. I'm not aware of that...
patna_in
New php-forum User
New php-forum User
 
Posts: 103
Joined: Sun Feb 06, 2005 10:54 am

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

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

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

I will quote gesf on this matter:

: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

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........
sanketce
New php-forum User
New php-forum User
 
Posts: 90
Joined: Fri Dec 02, 2005 3:23 am

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..
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län


Return to JavaScript

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron