jQuery - want to get input value for submit but it gets one and repeats
Posted
by jquery n00b
on Stack Overflow
See other posts from Stack Overflow
or by jquery n00b
Published on 2010-05-10T01:16:32Z
Indexed on
2010/05/10
1:18 UTC
Read the original article
Hit count: 279
I'm trying to replace all submit buttons with a span so cufon will work. The input still needs to be there so have done some css to hide it and overlay to span on top. My issue is getting the value from the input tag is proving quite diffcult. The code below gets the first input value (being 'search' from the search box at the top of the page, and then puts that value into all the spans, even for buttons that have different values (eg: send). This is a .NET page so the whole page is wrapped in one form tag. Any help is greatly appreciated.
jQUERY:
jQuery(document).ready( function() {
jQuery(".button-wrap input.button").each(function() {
var values = jQuery(".button-wrap input").attr('value');
jQuery(this).before("<span class='input-replacer'>" +values+ "</span>");
});
© Stack Overflow or respective owner