I want to get selected value from drop-down and display the value in textbox in SharePoint standard list form.
How can I achieve this?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityThis could be done using jQuery easily.
to get selected data you can use
$("#dropdownid option:selected").text();
And to populate text box
$("#textboxid").val("ValueYouWantToAssign")
You have to include jquery reference for using this. If using sharepoint 2013 it is already included.
For more info: http://api.jquery.com/
Using jQuery you can get the value from drop-down and display it in text-box:
//This gets selected value from drop-down control:
var ddl_value = $("#drop-downID option:selected").text();
//This updates and displays value from drop-down in text-box:
$("#textboxid").val(ddl_value);
But remember you cannot edit the default list forms. To add this code you should create a custom list form and make that form as the default form (edit/new). This can be achieved in SharePoint Designer.