0

I have a simple request from my manager to make a change in the default Edit Form for a share point list. I have a number field which allows one decimal value and a drop down field with dedicated, shared and select a value(default value) . I have a requirement to check if the number field is less than one then the drop down should be assigned to shared without the user selecting anything from the dropdown.

I am aware of jquery so if you could help please do. Thank you !

1 Answer 1

0

Add a script editor web part in new/edit form and add something like below:

 <script src="http://code.jquery.com/jquery-latest.js"></script>
 <script>
 $(document).ready(function () {
 $("input[title='numberfield']").change(function(){
if($("input[title='numberfield']").val()<=1)
{
    $("input[title='DrpNamefield']").val('Shared')
}
});
});
</script>
3
  • i figured out the way to do this but thank you for your help. in your code .val() < "1" changes should be made to make the code work, then only it is working! @deepmala Apr 9, 2018 at 8:51
  • Number fields shouldn't be encoded in quotes.
    – Deepmala
    Apr 9, 2018 at 8:53
  • i will keep that in mind ! Apr 9, 2018 at 8:55

Your Answer

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

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