Suresh Pattu
Suresh Pattu

Reputation: 6209

i am trying to get value of particular hidden input text box using jquery it's not working

i tried before insert this

 var req=$('#'+investor_id+'#requestId');
 var requestId=document.getElementById(req).value;
 alert(requestId);)

code it's it's working fine but after it's not working, here is code

Upvotes: 0

Views: 132

Answers (2)

rkw
rkw

Reputation: 7297

You should change your code a bit: http://jsfiddle.net/rkw79/9fTPh/17/

That fiddle cleaned up your code slightly, but you should normally take this steps:

1) hit the 'tidyup' button, then look for missing });

2) don't use id's if they're not unique, just use class

3) you do not have to set an id on everything just to find it, all objects are relative to each other

Upvotes: 1

Exception
Exception

Reputation: 8379

Why don't you access element with its id instead of writing pipings. ID values are unique in document.
Try this code

 alert($('#requestId').val()); 
 //Check here for working demo http://jsfiddle.net/9fTPh/6/

Instead of

 var req=$('#'+investor_id+'#requestId');
 var requestId=document.getElementById(req).value;
 alert(requestId);

And in the fiddle you have provided code us },) are not correctly given.(Check with JsLint)

Upvotes: 1

Related Questions