Reputation: 1
I am trying to set value to a hidden column. Previously i have achieved this by doing:
var bc = $("select[title='Broadcast Channel']").val();
$("select[title='Execution Channel']").val(bc);
This works fine as I am able to get the column which exist in html source.
Now I am trying to set value to a hidden column which I have hidden in Sharepoint 2010 list setting. And I am not able to find it under html source (e.g. <input type=hidden....>
).
How can I set value to this hidden column?
Upvotes: 0
Views: 1044
Reputation: 18568
In share point make the field as text input
and then using jquery
make it hidden
and then set the value. try something like
$('input[type="text"][title="abc"]').attr('type','hidden').val("abc");
Upvotes: 1
Reputation: 3129
There is a common problem that if an element is hidden from back end code, normally it is simply not rendered in the html generated. Elements that needs to be manipulated at the front end need to be shown but hidden using html or js code.
Upvotes: 0
Reputation: 840
Not sure if the following method will be acceptable to you, but here goes...
In sharepoint, make the input field non-hidden. Instead, make it invisible at document.ready() using JQuery. If the input field is given a specific ID/class name, you can get a reference to the same, and set the text (using text() function), or for more complex situations, consider enclosing it all in a div.
Best Regards, Gopal Nair.
Upvotes: 2