S
simplicity
Hi folks, can someone help with the following:
(1) I have a textinput which is a Adobe Spry object, well, just a
textinput with some additional features like validation etc. Im my
case it a number that I want to input.
(2) I set up some validation rules: min and max values, no alpha etc,
again some basic Spry stuff. I set this to be triggered onChange.
(3) When the value is invalid, eg. too large I display the icon with
onMouseOver triggering pop-up balloon containing error message.
(4) As I move the cursor away from the icon, I trigger onMouseOut
which is supposed to: close the balloon, revert the wrong value to
default.
So far all of the above work fine.
Here is the problem: as I revert the value of the textbox:
document.getElementById('txtBox').value = defaultValue, the onChange
event IS NOT triggered on the textbox. That means that I have a valid
value in the box and the error icon beside. Urghhhh!!!
I scanned the net looking for hints and it looks that changing the
value of textinput programatically DOES NOT trigger onChange for that
element. I found something promissing Firefox dispatchEvent() / IE
fireEvent() but i am not sure how to use it correctly. As expected,
dispatchEvent(onchange) generated nothing more than the javascrip
error :--(
Is there a way around it?
(1) I have a textinput which is a Adobe Spry object, well, just a
textinput with some additional features like validation etc. Im my
case it a number that I want to input.
(2) I set up some validation rules: min and max values, no alpha etc,
again some basic Spry stuff. I set this to be triggered onChange.
(3) When the value is invalid, eg. too large I display the icon with
onMouseOver triggering pop-up balloon containing error message.
(4) As I move the cursor away from the icon, I trigger onMouseOut
which is supposed to: close the balloon, revert the wrong value to
default.
So far all of the above work fine.
Here is the problem: as I revert the value of the textbox:
document.getElementById('txtBox').value = defaultValue, the onChange
event IS NOT triggered on the textbox. That means that I have a valid
value in the box and the error icon beside. Urghhhh!!!
I scanned the net looking for hints and it looks that changing the
value of textinput programatically DOES NOT trigger onChange for that
element. I found something promissing Firefox dispatchEvent() / IE
fireEvent() but i am not sure how to use it correctly. As expected,
dispatchEvent(onchange) generated nothing more than the javascrip
error :--(
Is there a way around it?