onClick submit FORM

Javascript coding ..

Moderators: egami, macek, gesf

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

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: 1716
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Sat Oct 15, 2005 1:22 am

Add this to your input: onclick="this.submit();"
Sincerely,
Gonçalo "gesf" Fontoura

gesf.org | sessionstart.com | urlms.com

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

Mon Oct 17, 2005 5:35 am

Thanks for reply

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

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...
Best Regards,
Alexej Kubarev
-------------------------------
Zend Certified Engineer
Image Image

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

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 !? :)
Sincerely,
Gonçalo "gesf" Fontoura

gesf.org | sessionstart.com | urlms.com

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

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... :)
Best Regards,
Alexej Kubarev
-------------------------------
Zend Certified Engineer
Image Image

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

Thu Oct 20, 2005 8:50 am

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

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

Thu Oct 20, 2005 9:01 am

:D
Sincerely,
Gonçalo "gesf" Fontoura

gesf.org | sessionstart.com | urlms.com

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

Thu Oct 20, 2005 9:13 am

I will quote gesf on this matter:
:D
Best Regards,
Alexej Kubarev
-------------------------------
Zend Certified Engineer
Image Image

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

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: 2214
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Fri Dec 02, 2005 11:15 am

well..i have already posted that.. and the JS is not needed for submitting ;)
But yeah..
Best Regards,
Alexej Kubarev
-------------------------------
Zend Certified Engineer
Image Image

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest