Skip navigation
dperani70
Currently Being Moderated

How do I change an objects value type depending on a Y/N Radio button?

Aug 9, 2012 11:54 AM

Tags: #script #livecycle_designer

I have the following code behind some Radio Buttons:

 

Form1645.Page3.TeeCrossSubform.TeeCross::exit - (JavaScript, client)

if Page3.TeeCrossSubform.TeeCross.rawValue = "N" {

    xfa.Page3.TeeCrossSubform.Disruptfield.access = "open";

    xfa.Page3.TeeCrossSubform.TeeCrossCC.access = "protected";

    }

else {

    xfa.Page3.TeeCrossSubform.Disruptfield.access = "protected";

    xfa.Page3.TeeCrossSubform.TeeCrossCC.access = "open";

    }

 

NOTE: I based this code on the following information (which may be wrong but I found nothing else on the subject): http://forms.stefcameron.com/2010/03/08/disabling-all-fields-within-su bform/

 

No matter which radio button is selected (Y or N) the fields are all "open" or "unprotected".

 

Any help is greatly appreciated!

 
Replies
  • Currently Being Moderated
    Aug 10, 2012 1:32 AM   in reply to dperani70

    Hi,

     

    I think you SOM expression is not correct.

     

    xfa.Page3.TeeCrossSubform.... should be xfa..Form1645.Page3.TeeCrossSubform...

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 10, 2012 6:28 AM   in reply to dperani70

    Hi,

     

    sorry my fault, the SOM expression still maybe wrong.

    Try

     

     

    Form1645.Page3.TeeCrossSubform.TeeCross::click - (JavaScript, client)
    if (xfa.form.Form1645.Page3.TeeCrossSubform.TeeCross.rawValue == "1") {
     
     
    xfa.form.Form1645.Page3.TeeCrossSubform.Disruptfield.access = "open";
     
     
    xfa.form.Form1645.Page3.TeeCrossSubform.TeeCrossCC.access = "protected";
     
    } else {
     
     
    xfa.form.Form1645.Page3.TeeCrossSubform.Disruptfield.access = "protected";
     
     
    xfa.form.Form1645.Page3.TeeCrossSubform.TeeCrossCC.access = "open";
     
    }
    
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points