-
1. Re: Combobox value is previous selection, not current selection
MarkWalsh Aug 26, 2012 2:18 PM (in response to DHeadrick)It's pretty hard to say what you're doing wrong, since you haven't included any of the code you are using.
I'm guessing you're using something like this in your custom validation script:
this.getField('TextBox').value = this.getField('ComboBox').value
The control's 'value' property hasn't been updated to the new value yet in the Validation script. Try using event.value instead:
this.getField('TextBox').value = event.value
Or, better yet, put the code into the textfield's calculate script:event.value = this.getField('ComboBox').value
-
2. Re: Combobox value is previous selection, not current selection
George_Johnson Aug 26, 2012 3:02 PM (in response to MarkWalsh)Mark likely nailed it, but note that if your combo box items have export values, event.value in the combo box's validate event will return the display value, and getting the value of the combo box in another field's calculate event will return the export value of the select item.
-
3. Re: Combobox value is previous selection, not current selection
DHeadrick Aug 26, 2012 3:09 PM (in response to MarkWalsh)Hi Mark,
Thanks!! I had never used "event.value" before, that's exactly what I needed to use.
Code-wise, I had this before (basically, the code you showed):
this.getField('ComboBox').value; // This always reports the previous value
Now, in my validation script, I use event.value, and it all works!!
It's always great to get a timely, concise answer, especially when I've probably spent 5 hours searching in vain for the answer myself.
Thanks again.
Dave



