Hello,
I'm new to Prototype development, and love the power it gives.
What I don't get is why the Drop Down change event fires only once,
for a dynamically created Select Drop Down, in my example below (using
1.5 of Prototype).
Any thoughts on this would be greatly appreciated by a ruby /
prototype newbee :)
Example:
Index.rhtml
<html><head><script>...
var categories = null;
function buildDynamicDropDown()
{
var url = 'dynaDropDown'; // returns <select id="categoryval"
name="categoryval"><option>...
new Ajax.Request(url,{
method: 'get',
onSuccess: function(transport){
categories = transport.responseText;
$('categoryval').replace(categories);
}
});
}
function init()
{
Event.observe('categoryval', 'change', alert('you changed the
category drop down'));
}
<head>
<body>
<form ...>
<span>
<select id="categoryval" name="categoryval">
<option value="1">Art</option>
<option value="6">Beauty</option>
</select>
</body></html>
Thanks,
Sjs
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---