Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



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
Trades: 0
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!
 
 
Register now for full access!
Reply     « Reply to fill one scriptaculous auto repeat base upon selection in another
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





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



Page generated in 0.08464 seconds with 12 queries