473,606 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

why AJAX based result is not correct / not displayed

2 New Member
i want to show the property details and there status (APPROVED, REJECTED, PENDING) the whole result is coming through ajax now i want that if i click on Approved icon or Pending icon or Rejected icon (seperate column on webpage for this) the status of property should be updated (become my selected status) through ajax and behind the scene the table of property should also be updated with the selected status.

Now the problem is that whole property details are being shown through ajax properly but when i click on the icon for e.g. Approved or rejected the status is not being updated and nothing is showing following is the code for ajax and php :

Any urgent reponse / solution will highly be appreciated..

Ajax Code:

Expand|Select|Wrap|Line Numbers
  1. var xmlhttp;
  2. var statdivName;
  3. function propState(propid,choice,divname) //divname for status particular div & choice is the selected status
  4. {
  5.     statdivName=divname;
  6.     alert(statdivName);
  7.  
  8. xmlhttp=GetXmlHttpObject();
  9. if (xmlhttp==null)
  10.   {
  11.   alert ("Browser does not support HTTP Request");
  12.   return;
  13.   }
  14. var url="updState.php";
  15. url=url+"?propid="+propid;
  16. url=url+"&choice="+choice;
  17. url=url+"&sid="+Math.random();
  18. xmlhttp.onreadystatechange=stateChanged;
  19. xmlhttp.open("GET",url,true);
  20. xmlhttp.send(null);
  21. }
  22.  
  23. function stateChanged()
  24. {
  25. if (xmlhttp.readyState==4 || xmlhttp.readyState=="complete")
  26. {
  27.  
  28.  
  29.   if (xmlhttp.status==200 || xmlhttp.status=="Ok")
  30.     { //if request was successful (versus "page not found" etc)
  31. alert(xmlhttp.responseText);//in this case the whole processing / updating status php code is being shown in alertbox
  32.  document.all(statdivName).innerHTML=xmlhttp.responseText; // in this case the result is shown in parent div not in particular div (in IE) and in firefox nothing is being displayed
  33.     }
  34. }
  35.  
  36.  
  37.  
  38. }
  39.  
  40. function GetXmlHttpObject()
  41. {
  42. if (window.XMLHttpRequest)
  43.   {
  44.   // code for IE7+, Firefox, Chrome, Opera, Safari
  45.   return new XMLHttpRequest();
  46.   }
  47. if (window.ActiveXObject)
  48.   {
  49.   // code for IE6, IE5
  50.   return new ActiveXObject("Microsoft.XMLHTTP");
  51.   }
  52. return null;
  53.  
  54. }
PHP Code:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $con=mysql_connect(....................................
  3. ...........................................
  4. .....................
  5.  
  6. echo $_GET['choice'];?>
Sep 3 '09 #1
3 1891
Markus
6,050 Recognized Expert Expert
I'm sorry - could you clarify your problem? I'm having a hard time following your post.

Mark.
Sep 3 '09 #2
fkhowaja
2 New Member
could u send me the code to update status on the same ajax generated page
Sep 3 '09 #3
Markus
6,050 Recognized Expert Expert
@fkhowaja
Negative.

We do not provide code, not matter how much you plead/beg. You can, however, hire me, and pay me to write the application for you. Other than that, this website is for helping people solve their problems, not hand out code that solves a problem.

So, if you're not up for hiring me, or any one else, you would start by clarifying your question.

Thanks,
Mark (moderator).
Sep 3 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

12
3116
by: whreed | last post by:
I am using AJAX XMLhttprequest to request another page on form submit and I am loading that page into a span tag. My issue is that I have more js in the called page that loads a calendar on click of a text box. This calendar never loads in my page but if I call the page by itself in a new window javascript works fine, any ideas? See Below when you call index and click the button the page does not show the alert, when you call getcall...
31
3103
by: Tony | last post by:
I just noticed that prototype.js is one of the files in the Ajax.NET distribution - I'm pretty concerned about this. Does anyone know if this is the same "prototype.js" that is not well-liked around here? If so, do you know if Ajax.NET can be used without prototype.js? -- "The most convoluted explanation that fits all of the made-up facts is the most likely to be believed by conspiracy theorists. Fitting the
1
1853
by: soeren.auer | last post by:
Hi all, we thought it could be interesting to experiment with equipping Wikipedia with some AJAX features. Result is a user interface for Wikipedia, which is largely based on AJAX, thus enabling previews of images or referenced articles without reloading the current Wikipedia page. Its called Pediax and accessible at: http://en.pediax.org
17
2792
by: eros | last post by:
During development (debugging) the site works well but when I release from the debugging and test into production.. All the AJAX was not performed.. the result from xmlHttp.responseText was not displayed. I added an alert in order to check if the script was called. The alert was displayed.
1
1857
by: bdbeames | last post by:
I have a page with google maps up and running. When a user clicks on a location from the map I would like to populate a drop down with data from the database related to that location. I have it up and working wonderful. Well that was what I thought until I tried it is IE. All that I get is an empty drop down. I know the problem is related to filling the element with the xmlHttp.responseText, but no matter how many solution I have tried as...
6
9814
by: KDawg44 | last post by:
Hi, My responseXML is always null on my AJAX call. When I browse directly to the PHP script I am calling, the XML file shows up just fine. I have read that if a returned XML file is not valid, it will always appear as null. I am just returning some basic XML like: <?xml version='1.0' encoding='UTF-8'?> <XMLData>
3
3366
by: pablosuk78 | last post by:
Dear coders, I'm facing a problem and after few research I found that many ppl were looking around for the same solution, hope someone more expert than me could give a good help. I created an AJAX function that i.e. on click does a request to a server and show into a specified tag the results (well until here is something eveyone would do with AJAX)... the point is that the result is something like the this: i.e. <!-- this is the...
1
4593
by: javediq143 | last post by:
Hi All, This is my first post in this forum. I'm developing a CMS for my latest website. This CMS is also in PhP & MySQL. I'm done with the ADD section where the Admin can INSERT new records in Database but I'm stuck in the EDIT. I'm getting 2 problems over here. Below is the description: 1)The FIRST page will list all the records from the table which Admin can EDIT with CHECKBOX for each record to select. He can select one or more than one...
0
7951
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8305
tracyyun
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...
0
6770
agi2029
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...
1
5966
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5465
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();...
0
3930
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3977
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2448
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
1
1553
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.