473,396 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to submit form through an image button?

hi,

I want to submit a form present on an webpage through javascript. But the problem is that there is no regular html submit button, istead there is an image submit button. Moreover, while I do the
Expand|Select|Wrap|Line Numbers
  1.  getElementById("myform").submit() 
nothing happens. For reference I am putting below the relvant html source of the form
Expand|Select|Wrap|Line Numbers
  1.  <input name="frno" type="text"  class="TextFielsdBRDR" id="frno" onfocus="chngcode(4,'focused');" onblur="chngcode(4,'blurred');" value="Mobile No" size="11" maxlength="10" autocomplete="off"/>
  2.  <span id="but_nonmember_sms">
  3.  
  4.                             <input type="image" src="../images/but_send.gif" alt="Send Free SMS" title="Send Free SMS" width="75" height="19" align="top" class="BRDRnone"/>
  5.                             </span>&nbsp;<br />
  6.                             <br />
  7.  
  8.  
Even the onsubmit doesnot work.
Please let me know how to submit this form through javascript. There is no id for the image submit button..
Nov 6 '10 #1
3 2415
Cmaza
16
Needs to be document.getElementById("myform").submit();

Had a similar problem in the past.

Hope this helps. :)
Nov 7 '10 #2
user Cmaza is correct, assuming that the id attribute of your form is exactly "myform"
Nov 9 '10 #3
Dormilich
8,658 Expert Mod 8TB
image submit button:
Expand|Select|Wrap|Line Numbers
  1. <button>
  2.     <img src="…" alt="…">
  3. </button>
Nov 9 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Ralph Freshour | last post by:
I'm trying to use an image as a submit button - I'm reading Sams Teach Yourself HTML and the chapter on this doesn't show me the details on how this is done - I mean I can't seem to see it or grasp...
0
by: Aung | last post by:
I have a on click method behind an image button on my form and i would like this event to trigger when user press Enter key also. This was default for every web form with normal button and...
3
by: Russell | last post by:
I have a web page that i am using an image button as my submit button. The code behind the button works, but when I click enter on the web page, nothing happens. Can anybody tell me how to get my...
4
by: Rob Meade | last post by:
Hi all, I have a page which displays some database results. On each column heading I have 2 images, an arrow up, and arrow down for my data sorting. The problem I have is that at the moment,...
1
by: Andy Rose | last post by:
..Hi all, I want to catch an 'enter' keypress event on a web form and submit the form as if a button had been clicked rather than the default post back behaviour. I know the following javascript...
1
by: nime | last post by:
I got an image button in a form. I want to simulate a click through programming. There is no Click method for HTMLElement. I tried el.RaiseEvent("Click") instead and an error occured. How can I...
1
by: Phil_Cam | last post by:
Hello All On a webpage I have a standard paypal image button for purchases. I am trying to set it up so that it only shows up or is endabled when text is entered into a textbox and a button is...
1
by: gbezas | last post by:
Hi All, I have added an event handler to redirect form.submit() to a newSubmit() method that I have defined (which does some additional processing before submitting the form). Additionally I...
14
by: white lightning | last post by:
How to have <select onchange="this.form.submit()"and also a Submit button on one form? I have something like this: <form action="<?php $_SERVER; ?>" method="post"...
13
Frinavale
by: Frinavale | last post by:
I've been trying all morning to cancel a form submit to the server. I have a JavaScript Object that determines whether or not the page should be submitted to the server depending on whether the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.