0

I'm learning Sharepoint 2013 . I have a new form to add data . In that form i have a web part add javascript . In that script i want add code custom this form and i want get ID through internal name of field but i can't find function in SP.FormCollection or SPClientTemplate So ,

How can i get ID field in form through internal name (Javascript)

I was try but it failed

var value = SP.FormCollection.get_item ()
  • Could you please share what you have done so far? – Akshay Belure Sep 30 '16 at 4:44
0

Consider you have a field called Level at your newform page and you need to get its ID, in this case ,I think it's easier to get the ID by its title name rather than internal name as the following

Try to add script editor , then add the following code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>

function getID()
{
alert($("input[title='Level']").attr('ID')); 

}

_spBodyOnLoadFunctionNames.push("getID"); 

</script>

This code will return the Control ID of the Level field .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.