Hi i have a problem.
I have 7 text boxex with different id's. I want to run a script via AJAX and i want to populate the result of the script in to these text boxes.
The code is -
function show(id)
-
{
-
id1=id;
-
-
xmlhttp=GetXmlHttpObject();
-
-
if (xmlhttp==null)
-
{
-
alert ("Your browser does not support AJAX!");
-
return;
-
}
-
-
var url="index.php";
-
-
xmlhttp.onreadystatechange=stateChanged;
-
xmlhttp.open("GET",url,true);
-
xmlhttp.send(null);
-
-
}
-
-
function GetXmlHttpObject()
-
{
-
if (window.XMLHttpRequest)
-
{
-
// code for IE7+, Firefox, Chrome, Opera, Safari
-
return new XMLHttpRequest();
-
}
-
if (window.ActiveXObject)
-
{
-
// code for IE6, IE5
-
return new ActiveXObject("Microsoft.XMLHTTP");
-
}
-
return null;
-
}
-
function stateChanged()
-
{
-
-
if (xmlhttp.readyState==4 )
-
{
-
if(xmlhttp.status==200)
-
{
-
form.elements[id1].value=xmlhttp.responseText;
-
}
-
else
-
{
-
alert("Danger");
-
}
-
}
-
}
-
-
-
-
This script basically call a php script and i displays the value in to text boxes.
When i run this script it displays the value in the last text box only. All other text boxes are empty.
Can any one assist me in this problem?
Regards
Dheeraj
12 1867
Updation.
function takes a argument id, which is basically text box id. I am reading it from a xml file and calling it.
code is: -
function ajaxcall()
-
{
-
var xmlDoc = callXML();
-
var length = xmlDoc.getElementsByTagName("pname").length;
-
-
-
for(var i=0;i<length;i++)
-
-
{
-
-
var id=xmlDoc.getElementsByTagName("pname")[i].getAttribute("id");
-
alert(id);
-
show(id);
-
-
}
-
-
}
-
so. When i place that alert intact after clicking ok for alert message it disalplays value in text box. if i remove it it will dislay the value in last text box.
Regards
Dheeraj
just a question, are your IDs unique?
that’s why you have the problem. Ids MUST be unique.
Sorry dormilich.. they are unique.....
do you have a page, where I can have a look at the whole thing?
Sorry... I cant give the link.
It is working fine in IE but not in FF.. Why this dependency...?
Is there any other way to takle it?
@dheerajjoshim
check the Error Console and the script with FireBug (Firefox debugger add-on) (that’s what I’d have made otherwise)
FF right IE wrong? In what sense?
@dheerajjoshim
in the standards sense (which is pretty much everything when it comes to web development)
@dheerajjoshim
I should have elaborated a little more:
If FF is not displaying something right, but IE is = your code is wrong (not up to standard)
If IE is not, but FF is = your code maybe right but needs a IE hack/workaround.
Dan
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Tom Fitzgibbon |
last post by:
Stupid question:
How do I loop through many text boxes on a page and get values for each box
and put into an array?
For example document.CreateEvent.test1.value will not take an array value...
|
by: Gertjan van Heijst |
last post by:
Hi,
I really hope someone can help me because I've already spend 2 days on
this problem and I'm not getting anywhere. I think the problem is that
I don't really understand how text boxes store...
|
by: Eskil |
last post by:
Hi
I have a form that supplies my query with information on two different
variables. The form uses a lookup to display a list of 5 different
customer types and 5 different types of...
|
by: ChadDiesel |
last post by:
I'm new to Access and need some advice. I am trying to setup a database to
print labels and reports for our shipments. I have set up a table with
fields such as
I have taken a snapshot of what...
|
by: ChadDiesel |
last post by:
I'm new to access and need some help.
I have a form with a shipment destination at the top. I then have a subform
that I enter boxes for that shipment. I have several shipments going at a...
|
by: Intrepid_Yellow |
last post by:
Hi,
I have the following code that runs my report generator. The user
selects a table from a combo box, then whatever fields they want from a
list box. (This part all works and the report runs...
|
by: David Plotts |
last post by:
I'm a beginner with VB.net, only had one class in college on it.
I can't seem to remember how to add text boxes up.
I want to add the values in text boxes together, and put the value into a...
|
by: kosta.triantafillou |
last post by:
Hi all,
I have a form that contains a lot of values. On this form there are
also alot of popups that can be brought up. One of them does the
following: Takes 2 values (x and y), concatenates...
|
by: mfaisalwarraich |
last post by:
Hi Experts Around the World.
Well im new to this paradise (Access). i have no experties in Access but i can still work with my mind :).
i wish to request you people as under:
I made a table...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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,...
|
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |