Why don't you put that code in the layoutReady event instead of the change event and just add an extra if condition that the dropdown list == whatever.
Could you explain this concept a little further? I am not familiar with the layoutReady event.
I wouldn't go down the layout:ready event route as overusing this event in a form can lead to performance issues. See here: http://assure.ly/nB0Bvz.
Instead why not have the script in the calculate event of the textfield? This way when ever the date or dropdown are changes the calculate event in the textfield will fire.
Hope that helps,
I'd put your script in the calculate event of Text_1.
Well that is not exactly an easy option based on my set up currently. I guess I could use it as a last resort but there is no command or event that would just simply cause it to update if a certain field was changed? Or maybe make the date field change the DDL field which in turn would change the other field?
reset my value}
I am not that experienced with livecycle so this could be impossible, I just thought there'd be an easier way that I am not aware of. I tried to put the script in the calculate field but then ran into 5 more problems.
EDIT: and to explain my issue a little further, I actually believe I'm using adapted code that come from one of your previous posts Niall (or possibly one of the other more prominent members of this forum) that assigns values to items in the DDL from arrays in global variables. I'm doing this because many different variables share the same bound value. The reason I can't remove it from my change event is it sends the value of the variable to this text box by taking the value of the entered variable. Hopefully that helps enlighten the problem.
It could be from an example, but without seeing the form/script it is difficult to say.
I would still recommend the calculate event of the textfield as the best option.
Where you have script in the change event of the dropdown, you would also need to add script into the exit event of the date field. This would reset the value of the textfield when the user exits. However this will not give as good a user experience, depending on the sequence the user follows when compling the form.
Maybe if you could share your form. If you can upload it to a file sharing site; publish it; and then post the published URL here.