0

I have a hidden field in my view. I have list of strings that i would like to put as comma separated values in to hidden field. I am trying to access the hidden field. Is it possible? Any other best practice?

2 Answers 2

2

Have you tried something like

$('input[name=hiddeninputname]').val(theValue); 
Sign up to request clarification or add additional context in comments.

2 Comments

+1 - another option might be the # syntax. $('#hiddenFieldId').val(theValue);.
Or if it is a runat="server" hiddenfield use $('#' + '<%= hiddenFieldId.ClientID %>').val(theValue);
0

For asp.net hiddenfield use this:

$("[id$=idofthehiddenfield]").val(commaseperatedvalues);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.