Hi all
Hope someone can help with the problem I am having as it is driving me nuts!
I have the below script on my site the problem lies with passing through a url parameter in the below line getCourseName
"ajax.requestFi le = 'getCourse.php? coursename='+ge tCourseName;"
if I change the above line to (Brackenwood being a value in my database all wors fine.
ajax.requestFil e = 'getCourse.php? coursename=Brac kenwood';
Can anyone see any problems in the below code?
My input box that I get the value from in the form has an id and name of coursename.
The script is a client lookup at dhtml goodies.
any help would be most appriciated thank you.
Tom -
-
var ajax = new sack();
-
var currentcoursename=false;
-
function getClientData()
-
{
-
var getCourseName = document.getElementById('coursename');
-
if(getCourseName!=currentcoursename){
-
currentcoursename = getCourseName
-
ajax.requestFile = 'getCourse.php?coursename='+getCourseName; // Specifying which file to get
-
ajax.onCompletion = showClientData; // Specify function that will be executed after file has been found
-
ajax.runAJAX(); // Execute AJAX function
-
}
-
-
}
-
-
function showClientData()
-
{
-
var formObj = document.forms['calc'];
-
eval(ajax.response);
-
}
-
-
-
function initFormEvents()
-
{
-
document.getElementById('coursename').onblur = getClientData;
-
document.getElementById('coursename').focus();
-
}
-
-
-
window.onload = initFormEvents;
-
7 3169 acoder 16,027
Recognized Expert Moderator MVP
You need
getCoursename is the object - you need its value.
You need
getCoursename is the object - you need its value.
Thank you for your reply I will give it ago asap, am I right in thinking where I have references to "getCoursen ame =" it should be getCoursename.v alue =
I'm new to Ajax and have only ever used Javascript very briefly.
Thanks for your help.
Tom
acoder 16,027
Recognized Expert Moderator MVP
Thank you for your reply I will give it ago asap, am I right in thinking where I have references to "getCoursen ame =" it should be getCoursename.v alue =
Yes, that's correct.
Yes, that's correct.
Hi thank you for all your help I have amended all references to include the .value but still nothing works.
here is the original code from dhtml goodies -
var ajax = new sack();
-
var currentClientID=false;
-
function getClientData()
-
{
-
var clientId = document.getElementById('clientID').value.replace(/[^0-9]/g,'');
-
if(clientId.length==4 && clientId!=currentClientID){
-
currentClientID = clientId
-
ajax.requestFile = 'getClient.php?getClientId='+clientId; // Specifying which file to get
-
ajax.onCompletion = showClientData; // Specify function that will be executed after file has been found
-
ajax.runAJAX(); // Execute AJAX function
-
}
-
-
}
-
-
function showClientData()
-
{
-
var formObj = document.forms['clientForm'];
-
eval(ajax.response);
-
}
-
-
-
function initFormEvents()
-
{
-
document.getElementById('clientID').onblur = getClientData;
-
document.getElementById('clientID').focus();
-
}
-
-
-
window.onload = initFormEvents;
-
-
I amended the following line: - var clientId = document.getElementById('clientID').value.replace(/[^0-9]/g,'');
so that I can use values that are not only numerical, I have also placed the .value at the end of document.getEle mentById('cours ename') but still no joy.
Thank you for your help
Regards
Tom
acoder 16,027
Recognized Expert Moderator MVP
Can you post your form HTML markup.
Can you post your form HTML markup.
Hi sorry to have bothered you I made a typo when adding the .value to the end of the ID element.
The script works now sorry for wasting your time, I have very little knowledge of JavaScript and AJAX.
Thank you for your help.
acoder 16,027
Recognized Expert Moderator MVP
Hi sorry to have bothered you I made a typo when adding the .value to the end of the ID element.
The script works now sorry for wasting your time, I have very little knowledge of JavaScript and AJAX.
Thank you for your help.
No problem at all. Glad you got it working in the end.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: www.web20developers.com |
last post by:
http://www.web20developers.com
http://www.web20developers.com/index.php?option=com_content&task=view...
Ajallerix : AJAX, simple, fast Web image gallery demo ; at Novell
AJAX - microlink pattern tutorial : A microlink is a link that opens up
|
by: danxavier |
last post by:
I successfuly installed dd.php and sajax.php files. It runs fine, but I would like to link the $items to an image. I called the field in mysql with the link "pic". Any help would be AWESOME!!! I've run out of ideas.
Here's the script
<?php
/*
CREATE TABLE `layout` (
`set` varchar(50) NOT NULL default '',
`item` varchar(50) NOT NULL default '',
`order` int(9) NOT NULL default '0',
|
by: gunimpi |
last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431
********************************************************
VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help
wanted
********************************************************
For this teeny job, please refer to:
http://feeds.reddit.com/feed/8fu/?o=25
|
by: trpost |
last post by:
I am using ajax / php where I am looking up some info from the
database and populating a select list dynamically, however I am
running into some sort of size limitation with the ajax.response
object. If the string I am passing to javascript from php is too large
javascript does not get it all the data. The magic number appears to
be 6123 characters, anything below that it works fine, anything above
and if I alert the ajax.response, I see...
|
by: nicksname7 |
last post by:
Hi, I am a newbie in the AJAX world. first of all, take a look at my script first:
assume this script is saved as "myAjax.js"
//-----------------inside myAjax.js--------------------
function AJAX()
{
var isBusy = false;
var obj = null;
var url = "";
var Method = "";
| |
by: Chrisjc |
last post by:
I am hoping someone can help me out here. I am trying to make one drop down box pull from a database the DB name is “dealerlocater” the column it needs to pull in this drop down is called “state” Once it loads all the states in the drop down box it then needs to be able to do the following.
Once a user selects a state it will load all information listed in the ROWS of the state column I.E.
++++++++++++++++
+ Select Your State + Pulls...
|
by: shaunwo |
last post by:
I'm an AJAX / DOM Novice (at best) and trying to figure out how to write the value to a couple input fields. I don't remember exactly where I got the ajax.js file I'm using from (went to the website that I see in the comments, but no luck there), but what I already have works GREAT to populate the options in a select box. Now I'm trying to take that same code and get it to write the value to a couple input boxes.
Here's a link to my ajax...
|
by: shawnwperkins |
last post by:
Hi Folks,
I'm new to Javascript and just need a little help. I downloaded a
script from Dynamic Drive's Web site and I'm trying to make a simple
modification and could use some help. :)
The script below fetches data from the web server and displays it in
the form as a ticker on the web page. See: http://www.dynamicdrive.com/dynamicindex2/ajaxticker.htm
What I would like to do is to have the Ajax ticker periodically go out
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |