473,385 Members | 1,569 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,385 software developers and data experts.

How can you programatically submit a type image

if i have an Input type Image
how am i suppose to programatically submit it through JS.

code:

<INPUT type="text"
onkeyup="javascript:if(event.keyCode==13){btnClick .click();}">

<INPUT name="btnClick" type="Image" value="Button"
onclick="javascript:alert('button was clicked');">

clicking "btnClick" will raise the onclick event producing 'button was
clicked', but onkeyup of the textbox will not call the click() method

Im using Input type Image because that is what ASP.net produces for an
image button.

Jul 23 '05 #1
2 1658
In article <11**********************@g49g2000cwa.googlegroups .com>, jw56578
@gmail.com enlightened us with...
if i have an Input type Image
how am i suppose to programatically submit it through JS.


input type=image will automatically submit its form onclick.
<input type="image" name="whatever" src="myButton.gif" alt="submit">

No JS required.

The onclick is automatically script. Ditch the "javascript:".
onclick="somefunction();"

There is no such thing as submitting a button. If you want to submit the form
without clicking the button (from another form element handler), use
something like
onClick="this.form.submit();"

--
--
~kaeli~
When a clock is hungry, it goes back four seconds.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
That was no help, thanks. But I changed from onkeyup to onkeydown and
it worked, so nevermind.

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Nicolas Keller | last post by:
Hi! I'm used to have Mozilla for testing my PHP sites when I'm coding. The site's nearly finished, now I've made a test with the Internet Exlporer... guess what... failed. The problem: I'm...
2
by: Colin Steadman | last post by:
I have two buttons on my form and need to know which was clicked. If I setup the buttons like this: <input type="submit" value="submit" name="submit_to_array"> <input type="submit"...
4
by: Ice Man | last post by:
Hi all How Can I submit a form by clicking on an image instead of the submit button? Thanks
4
by: Csaba2000 | last post by:
I want to be able to programatically click on the center of an <INPUT type=image ...> element (I only care about IE 5.5+). This should work regardless of whether IE has focus. Normally you would...
2
by: Matt | last post by:
In the following code, I have 2 questions regarding submit button with image. 1) Does this code <input type="image" name="populate" src="populate.gif"> behave the same as an HTML submit button...
5
by: Steve JORDI | last post by:
Just a question using images as submit buttons and PHP4.4.4. It seems that my code correctly works in FireFox but not in IExplorer. For example, I have a FORM with 2 buttons called "search" and...
10
by: The Natural Philosopher | last post by:
I am coding up a bit of javascript stuff, and have managed to stumble my way through most of what I want.. But this one has got me stumped. I call submit() and get a javascript error 'Submit...
2
by: sbettadpur | last post by:
Hi everybody, Hi iam strugling with more than one submit buttons with in one form here is my code <form method="post" action="Offer.php" name='issueFrm' onSubmit="return fullOfferfields();">...
7
by: Petr Vileta \(fidokomik\) | last post by:
I have a form with few text inputs. Every text input is followed by image type input. In this form I want to have 1 submit button on the top. A problem I want to resolve is: when user type...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.