Welcome Guest, Not a member yet? Register   Sign In
form_dropdown('shirts', $options, 'large', ' onChange="this.form.alert(this.val());"'); onChange does not work
#1

[eluser]Julia Yan[/eluser]
as title, I want test onChange, but it does not work?
' onChange="this.form.alert(this.val()Wink;"'
#2

[eluser]metaltapimenye[/eluser]
Code:
form_dropdown(‘shirts’, $options, ‘large’, ’ onChange=“alert(this.val());”’);
.. if problem persist, see the page source, let us see how it rendered
#3

[eluser]tonanbarbarian[/eluser]
you might also consider looking at the html source that is generated and seeing if that helps you diagnose the issues.
even post the generated html here and someone might be able to give advice
#4

[eluser]Federico Baña[/eluser]
the problem is in the javascript, the error should say that ".val()" is undefined. the right way to do it is: onchange="alert(this.value)"
#5

[eluser]Julia Yan[/eluser]
[quote author="Federico Baña" date="1293131912"]the problem is in the javascript, the error should say that ".val()" is undefined. the right way to do it is: onchange="alert(this.value)"[/quote]
Thanks Federico Baña, it works with your code.




Theme © iAndrew 2016 - Forum software by © MyBB