We help IT Professionals succeed at work.

Convert jquery link to an image button.

birwin
birwin asked
on
Medium Priority
2,043 Views
Last Modified: 2012-05-06
I am using the following link to call up a page: <a href="javascript:sortSummaries('views')">Sort By Views</a>

The jquery function this triggers is: function sortSummaries(id) {$("#summaries").load("browse_content.php?sort="+id+"");}

How can I convert this to use an image button?

(Note: for some reason EE removes the plus signs on either side of  id in the function)


<a href="javascript:sortSummaries('views')">Sort By Views</a>
 
function sortSummaries(id) {$("#summaries").load("browse_content.php?sort="+id+"");}

Open in new window

Comment
Watch Question

You want to change your link to a button?

If so

instead of

<a href="javascript:sortSummaries('views')">Sort By Views</a>

use:

<input type="image" src="x.jpg" onclick="sortSummaries('views')"/>


Another example:

http://www.webdevelopersnotes.com/tips/html/using_an_image_as_a_submit_button.php3

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Thank you. This worked perfectly.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.