By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,929 Members | 634 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,929 IT Pros & Developers. It's quick & easy.

Is an image button pressed in JavaScript?

P: 31
Hi,

I have two text box and an image submit button. how should I know if the button has been pressed in a JavaScript?
Regards,
FF
Jun 9 '08 #1
Share this Question
Share on Google+
5 Replies


jeffstl
Expert 100+
P: 432
If the image your are referring to is contained in a <a href> tag for a link you would add a onclick event to that link
Jun 9 '08 #2

P: 31
Hi ,

Thanks for your response.

my image is :
<input type="image" src="images/btn_search.gif" height=20 name="searchbutton" id="searchbutton" alt="submit" border="0">

and I want to put an If clause in a Script that check if this button has been pressed or not!

Do you have any idea how?

Thanks
Jun 9 '08 #3

jeffstl
Expert 100+
P: 432
Expand|Select|Wrap|Line Numbers
  1.  
  2. <input type="image" src="images/btn_search.gif" height=20 name="searchbutton" id="searchbutton" alt="submit" border="0" onclick="javascriptcall"()>
  3.  
  4.  
Jun 9 '08 #4

P: 31
And how should I check in the function(javascriptcall) if the button have been pressed?



Expand|Select|Wrap|Line Numbers
  1.  
  2. <input type="image" src="images/btn_search.gif" height=20 name="searchbutton" id="searchbutton" alt="submit" border="0" onclick="javascriptcall"()>
  3.  
  4.  
Jun 9 '08 #5

jeffstl
Expert 100+
P: 432
And how should I check in the function(javascriptcall) if the button have been pressed?
DrBuch answered that in your other post. The javascript will fire when the user clicks the button. You know he clicks it if the function is called.

Other Post showing javascript
Jun 9 '08 #6

Post your reply

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