11-17-2011 05:59 PM
addValidator for Required Fields
We would like to be able to control the assignment of the field validation (required fields) based of a selection by the user on the order form.
I have been able to assign this to a field based off of a selection, however, I would also need to remove it if the selection changes. This is where I am running into problems. I can't seem to remove it once it's added.
Has anyone been successful in doing this? I know I'm missing something here...
11-17-2011 05:59 PM
This should work:
serviceForm.dictionaryName.fieldName.validators = ''
11-17-2011 05:59 PM
Here's what I did:
function S1476_Coop_Modify_Question4_onClick () {
rcDebugLoad("Entering Function S1476_Coop_Modify_Question4_onClick");
var secOwner = gethtmlinputvalues ('Coop_Modify.Question4');
if (Moment == 'ordering') {
switch (secOwner) {
case 'No':
document.all['Coop_Modify.Question5.Row'].style.display = 'none';
docum
11-17-2011 05:59 PM
Ok, this one is hitting it over the head, but it should work:
Set the options[0].value of the field back to a non-null value, for example, "N/A", "not applicable", or the original "Please select" value, so the validator wouldn't apply.
Make the field non-mandatory.
11-17-2011 05:59 PM
Hi Leslie,
You're right, that would work. I certainly appreciate your feedback on this discussion.
I may try to write something that mimics the addValidator method, but add a switch that would turn it on and off. We'll see if I have time to do that in the coming weeks.
Thanks!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide