instead of using attr('value')... try using val()
Rick
-----Original Message-----
Date: Saturday, July 11, 2009 2:13:10 pm
To: "jQuery Development" <[email protected]>
From: "barun" <[email protected]>
Subject: [jquery-dev] Re: Display values of variable number of text boxes
Thanks, Rick! That's an excellent example, and I could achieve my
functionality with that. However, I would like to know if we could
access the value with the text box name also. For example, if we know
that the text box's name is text_1, then we could use like:
$("form input#text_1").attr("value");
In this case the name is dynamically generated. So, I tried with
txt_name = "text_" + i; // i is a counter
$("form input#" + txt_name).attr("value");
But this doesn't seem to work. Any syntactical error?
This way of working would be useful in other cases too. For example,
if we want to know the value of the i-th text box.
Thanks,
Barun.
On Jul 11, 8:36 pm, Rick Waldron <[email protected]> wrote:
> When the user specifies the textareas, assign them a special "logic"
> classname... like "user-textarea"
> I put together an example:
>
> http://jsbin.com/oqomi
>
> Rick
>
> On Sat, Jul 11, 2009 at 10:25 AM, barun <[email protected]> wrote:
>
> > Hi All,
>
> > Ther
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---