0

I have a custom list (serving as a change control form), which I'd like to tweak a little. my Jquery isn't my strongest suit, hance my asking you guys for help. I'd like to ask if it's possible to set field values on a form depending upon selections in another column. Specifically

  1. If DateField is Filled, Set ChoiceField to Specific Option
  2. If ChoiceField is a Specific Option, Prompt for DateField to be filled out (Can I cater for this in List Validation?)

Hope that's clear, please let me know if not and I'll be happy to try re-explain.

Thanks, Steven

1 Answer 1

1

This is certainly all doable with jQuery. My personal preference is to use selectors like $("input[Title='My Field']") to get the fields I want. Both should be simple change functions:

$("input[Title='My Field']").change(function(){
  $("input[Title='My Other Field']").val("Something");
  //or any other type of logic, like:
  // if ($(this).val()=== "something"){$("input[Title='My Other Field']").val("Something");}
});

Point 2 would be something like:

$("input[Title='Conditional Field']").hide();
$("input[Title='My Field']").change(function(){
  alert("Please fill out this other field");
  $("input[Title='Conditional Field']").show();
});
2
  • Hi Eric, Thanks for the post. I'm going to try this tomorrow and will mark / ask as I go. Cheers, Commented Jun 3, 2013 at 16:58
  • No problem, without seeing your form code and whatnot, these are just general guidelines, the selectors are the key though. Commented Jun 3, 2013 at 17:47

Your Answer

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

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