shortysbest Posted July 14, 2010 Share Posted July 14, 2010 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. Link to comment https://forums.phpfreaks.com/topic/207749-click-submit-get-boxval-of-correct-text-area/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.