2

I cannot seem to get the test in the 'Value' field

<input name="ctl00$PlaceHolderMain$ctl01$ctl12$ctl00$HiddenUserFieldValue" type="hidden" id="ctl00_PlaceHolderMain_ctl01_ctl12_ctl00_HiddenUserFieldValue" value="24;#Ryan,, C,#i:0#.f|membership|cryan@corp.blah.net,#CRyan@blah.com,#C_Ryan@blah.com,#Ryan,, C">

How can get the data in the value field?

Thanks.. I know this should be easy but I'm about to shoot myself.

Tim
  • 563
  • 2
  • 6
  • 20

2 Answers2

1

as id is there you should use # before the ID

var myval = $("#ctl00_PlaceHolderMain_ctl01_ctl12_ctl00_HiddenUserFieldValue").val();
Punit Gajjar
  • 4,937
  • 7
  • 35
  • 70
1

Use the below code to fetch the element's value by id in jQuery. Check your output in console.

console.log($("#ctl00_PlaceHolderMain_ctl01_ctl12_ctl00_HiddenUserFieldValue").val());
<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
<input name="ctl00$PlaceHolderMain$ctl01$ctl12$ctl00$HiddenUserFieldValue" type="hidden" id="ctl00_PlaceHolderMain_ctl01_ctl12_ctl00_HiddenUserFieldValue" value="24;#Ryan,, C,#i:0#.f|membership|cryan@corp.blah.net,#CRyan@blah.com,#C_Ryan@blah.com,#Ryan,, C">
Thanga
  • 7,811
  • 3
  • 19
  • 38