Page 1 of 1
editable select option onchange event not working
Posted:
Sat Dec 16, 2006 12:36 am
by shobana
I have added the editable select option in my php scripts. It works fine. But I have a rule to fire onchange event. The text box with editable option is not working with onchage event.
Your help is appreciated.
Regards
Shobaan
Posted:
Sat Dec 16, 2006 12:52 am
by Batalf
RE:editable select option onchange event not working
Posted:
Mon Dec 18, 2006 7:22 pm
by shobana
RE:editable select option onchange event not working- Solved
Posted:
Wed Dec 20, 2006 6:15 pm
by shobana
Hello Batalf
Problem got solved. I just added a javascript function at the end of selectOptionValue() function and onchange event works good.
My basic need was whenever an option is selected from the select option textbox i need to load another dropdown based on the value selected.
Its works Cool.
Thanks
Shobana
Posted:
Tue Mar 20, 2007 3:49 am
by ReneMarty
Hi Shobana, could you give me a short code example of how to put the onChange() in the editable select box, please?
Thanks,
Posted:
Thu May 10, 2007 7:40 pm
by shobana
Hi Rene
Here is the Code.
function selectOptionValue()
{
var parentNode = this.parentNode.parentNode;
var textInput = parentNode.getElementsByTagName('INPUT')[0];
textInput.value = this.innerHTML;
this.parentNode.style.display='none';
document.getElementById('arrowSelectBox' + parentNode.id.replace(/[^\d]/g,'')).src = arrowImageOver;
if(navigator.userAgent.indexOf('MSIE')>=0)document.getElementById('selectBoxIframe' + parentNode.id.replace(/[^\d]/g,'')).style.display='none';
setValue1(textInput,textInput.id);
}
Just Add a javascript function at the end of selectOptionValue(). In my example "setValue1" gets fired whenever the value in the select option gets changed.
Let me know if you have any problem.
Regards
Shobana