I have page with 3 textbox. I to find all textboxes which have value into it and print its text. How to do?
+1
A:
I gess that you need either
$("input[type=text]").val();
or
$("textarea").val();
Most likely, you will need both, so
$("input[type=text][value!=] textarea[value!=]").val();
would search the contents of all non empty elements on your page a user can insert text into.
voyager
2009-09-15 13:20:44
A:
Use selector/text and selectors/attributeNotEqual.
$("form input:text[value!=]").each(function() {
$(this).val();
});
ranonE
2009-09-15 13:21:12
+3
A:
This is the code to fetch all the values of the in a page which are not empty:
$('input[type=text][value!=]').each( function() {
var value = $(this).val();
// do whatever you want with the value
});
Keeper
2009-09-15 13:23:13
Thankyou it will worked!
Mario
2009-09-15 13:28:03