Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

field erases itself when changing another field

Avatar

Not applicable

Hi,

i'm having the strangest behaviour on my form...

in my master page, i have one text field called "Patient"

in my regular page, i have a drop-down list called "timepoint".

this list has two possible values: "Baseline" and "Early".

I added some javascript code to hide some other fields if the user selects "Baseline":

if(this.rawValue == "Baseline") {

          SPIMCF.SPIM_Compliance_Form.Point_of_violation.Dose_baseline_value.presence = "hidden";

          SPIMCF.SPIM_Compliance_Form.Point_of_violation.Dose_baseline_value_unit.presence = "hidden";

          SPIMCF.SPIM_Compliance_Form.Point_of_violation.delay_baseline_value.presence = "hidden";

          SPIMCF.SPIM_Compliance_Form.Point_of_violation.delay_baseline_value_unit.presence = "hidden";

} else {

          SPIMCF.SPIM_Compliance_Form.Point_of_violation.Dose_baseline_value.presence = "visible";

          SPIMCF.SPIM_Compliance_Form.Point_of_violation.Dose_baseline_value_unit.presence = "visible";

          SPIMCF.SPIM_Compliance_Form.Point_of_violation.delay_baseline_value.presence = "visible";

          SPIMCF.SPIM_Compliance_Form.Point_of_violation.delay_baseline_value_unit.presence = "visible";

}

When i try the form, the code works well: the fields are hidden for "Baseline" and visible for "Early".

But either way, the text that was in my field Patient in the master page erases itself each time i select one of the dropdown list value.

I had the exact same code for another form, and everything was working well. Now i have this problem and i have absolutely no clue where the problem is. I checked everything, the names, the links, the xml source... and found nothing.

but it seems it has something to do with the javascript lines: when i delete the lines for hiding the fields, then the Patient field is OK...

hope someone got a solution for me

thanks

0 Replies

Avatar

Level 10

Hi,

The layout:ready event will fire everytime an object on the form is changed. Make sure that there isn't script in the Patient object on the Master Page.

Also set the binding of the Patient object to Global (see Object > Binding palette).

Good luck,

Niall

Avatar

Not applicable

Thanks.

i noticed the binding of my field Patient was "none". I changed it to "normal" and everything was fine.

Avatar

Level 10

Hi,

If your form can grow and overflow onto a new page, then Global works better. If the page layout is fixed, then Normal is fine.

Niall