Reply
fill one scriptaculous auto repeat base upon selection in another
Old 09-10-2007, 09:53 PM fill one scriptaculous auto repeat base upon selection in another
Junior Talker

Posts: 1
Name: Charles Russell
I am new to scriptaculous but not new to coding. I am having an issue trying to get a change event to fire. Here is the setup I have an xml file listing all of the states and the cities in them. This file is used to create a Scriptaculous Ajax.Autocomplete. I am successfull at getting this to work for the state selection. I am having trouble with the next step. Once a selection is made I want enable the city selector and populate it. My plan was to trace the code to make sure I understand the prototype $A call correctly then if correct create a local autocomplete but the change event on the text control did not fire. I have tried several variants the most current is trying to us the afterUpdateElement option. I have tried setting up an event listner setting a funtion on the onchange event, and many other things I am missing a step but I cant find what it is. Maybe there is something with parmeters I'm lost Help.

Code:
 
// Java Script File Requires scriptaculous and prototype libraries
//This file provides supporting JavaScript for the dealer network page
var stateText =
{

init:
{


var stateCompleter = new Ajax.Autocompleter("txtState", "state_complete", "PScripts/autoCompleteStateHandler.php", {afterUpdateElement:stateChangeHandler()});

}


}
//Handle the change event for the state text box
function stateChangeHandler(input,item)
{/**************************I am not able to get here ***************************/
//Set up Ajax Request Object
new Ajax.Request(
"PScripts/list_cities.state="+input), //$F will get the value in the txtState control
{
method:"get",
onComplete:function(xhr){
citiesXML=xhr.response.xml;
setCity(citiesXML);
}
}
 
function setCity(cityData)
{
cityArray = $A(cityData);
}
Core.start("stateText");//This function is from another library it just causes initialization in window.onload
crussell is offline
Reply With Quote
View Public Profile Visit crussell's homepage!
 
When You Register, These Ads Go Away!
Reply     « Reply to fill one scriptaculous auto repeat base upon selection in another
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Webmaster Resources Marketplace:
Software Development Company | Webhosting.UK.com | Text Link Brokers 


   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12413 seconds with 12 queries