Wrox Programmer Forums
|
Ajax the combination of XHTML, CSS, DOM, XML, XSLT, XMLHttpRequest, and JavaScript
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Ajax section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 8th, 2006, 01:31 PM
Registered User
 
Join Date: Feb 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to shookim Send a message via Yahoo to shookim
Default suggestions3a.js

I had a question about the StateSuggestion() function. I'm using this entire autosuggest_Part3 (part a) as the base for my own code. I'm actually using manager names instead of states. I've written code that includes an xml DOM to pull server-side data and create javascript like below.

(ORIGINAL)

function StateSuggestions() {
    this.states = [
        "Alabama", "Alaska", "Arizona", etc..
    ];
}

(MY CODE)

ManagerSuggestions = "this.manager = [" + aManagerName + "];"
alert(ManagerSuggestions);

The problem is the alert box actually creates an alert popup like the original code and eventually looks like:

this.manager = [
  "FIRSTPERSON_LN, FIRSTPERSON_FN",
  "SECONDPERSON_LN, SECONDPERSON_FN",
  "SECONDPERSON_LN, SECONDPERSON_FN"
  ];

but it doesn't work bc as soon as I type into the textbox where the autosuggest control should fire from, I get this error that reads:

'this.managers.length' is null or not an object

HELP!

 
Old February 8th, 2006, 01:41 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Is it manager or managers?

--

Joe (Microsoft MVP - XML)
 
Old February 8th, 2006, 03:33 PM
Registered User
 
Join Date: Feb 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to shookim Send a message via Yahoo to shookim
Default

oops, that was suppose to read

this.managers






Similar Threads
Thread Thread Starter Forum Replies Last Post
To include a js file into another js file jdang67 Javascript 4 February 28th, 2008 03:32 AM
convert js to vs. rupen Other Programming Languages 0 December 26th, 2006 06:57 AM
JS Script help... Thomas82 Classic ASP Basics 2 April 29th, 2005 05:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.