Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 9244

CRM 2011 : Issue with Two Option Set in javascript

$
0
0

Hi

I have a created a small javascript functionality where in, onload both the radio buttons(Two - Option Set) are set to null and when i click 'Yes' or 'No' a field becomes required.

Here is the Code -

    document.EntityScript.IsDocumentSubmittted_OnChange = function () {
    if (Xrm.Page.getAttribute("new_hassubmitted").getValue()) != null) {
         var field = Xrm.Page.getAttribute("new_specifydetail");
         field.setRequiredLevel("required");
    }
    else
        var field = Xrm.Page.getAttribute("new_specifydetail");
        field.setRequiredLevel("none");
    }

and on load i have written this -

    Xrm.Page.getAttribute("new_hassubmitted").setValue(null);

Now the problem is 

<b>On page load,when i click 'No' for the first time , the function does not get invoked however when i click 'Yes' the function gets invoked and after that if i click 'No' the function gets invoked </b>

I want to know What value gets stored in the two-optionset when we set it as 'null'



Viewing all articles
Browse latest Browse all 9244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>