Jump to content

click submit, get boxval() of correct text area


shortysbest

Recommended Posts

I have a comment system, with multiple posts on a page, i want people to be able to comment on the post they want, I need to get the id of the correct texta area, and button. I can get it how i want, except When im using a variable:

 

$j(".status-button").click(function() {
var element = $j(this);
var I = element.attr("id");
var boxval = $j('#profile-comment4').val();

alert(boxval);

 

when i have #profile-comment4 it gets it, however when i put

 

$j(".status-button").click(function() {
var element = $j(this);
var I = element.attr("id");
var boxval = $j('#profile-comment'+I).val();

alert(boxval);

 

it comes back as undefind.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.