473,550 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

my xhr does not work on ie

35 New Member
it works perfect on safari and ff but not on ie,any thoughts?, thanks for your help

Expand|Select|Wrap|Line Numbers
  1. function xhr(){
  2. var xmlHttp=null;
  3. try{xmlHttp=new XMLHttpRequest();}
  4. catch (e){
  5. try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
  6. catch (e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  7.   }
  8.  }
  9. return xmlHttp;
  10. }
  13. valid=new xhr();
  14. function validation(){
  15. var nom=document.forms.recommander_ce_blog.nom.value;
  16. var email=document.forms.recommander_ce_blog.email.value;
  17. var message=document.forms.recommander_ce_blog.message.value;
  18. valid.onreadystatechange = alertContents;
  19. valid.open('get',"validation_recommander_ce_blog.php?nom="+nom+"&email="+email+"&message="+message+"&id="+Math.random(), true);
  20. valid.setRequestHeader('If-Modified-Since','Wed, 05 Apr 2006 00:00:00 GMT');
  21. valid.send(null);
  23.       }
  24. function  alertContents(){
  25. if (valid.readyState == 4) {
  26. result = valid.responseText;
  27. var div=document.getElementById('recommander_ce_blog_error_message')
  28. div.innerHTML = result;
  29. if (div.innerHTML=="<b>Merci!</b>"){
  30. document.getElementById("recommander_ce_blog").style.display="none";

the form:
Expand|Select|Wrap|Line Numbers
  1. <form  action="javascript:validation()"  id="recommander_ce_blog" name="recommander_ce_blog" >
  2. <table style="height: 148px;" border="0" width="282">
  3. <tr>
  4. <td>nom:</td>
  5. <td><input name="nom" type="text" /></td>
  6. </tr>
  7. <tr>
  8. <td>email:</td>
  9. <td><input name="email" type="text" /></td>
  10. </tr>
  11. <tr>
  12. <td valign="top">message:</td>
  13. <td><textarea name="message"></textarea></td>
  14. </tr>
  15. <tr>
  16. <td></td>
  17. <td><input name="submit_recommander_ce_blog" type="submit" value="Submit" /></td>
  18. </tr>
  19. </table>
  20. </form>
May 10 '09 #1
6 1536
5,390 Recognized Expert Moderator Expert
what exactly is not working in IE?

kind regards
May 10 '09 #2
35 New Member
on ie i only get the first php validation error(nom wich is name) and it stuck there

php validation code:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. Header('Cache-Control: no-cache');
  3. Header('Pragma: no-cache');
  5. $nom=$_REQUEST["nom"];
  6. $email=$_REQUEST["email"];
  7. $message=$_REQUEST["message"];
  10. if(trim($nom)==""){
  11. print("un nom svp");
  12. }
  13. else if(trim($email)==""){
  14. print("un mail svp");
  15. }
  16. else if(!email_valid($email)){
  17.  print("un mail valide svp");
  18.     }
  19. else if(trim($message)==""){
  20.   print("un message svp");
  21. }
  22. else{
  24. $to='dddd@gmail.com';
  25. $subject = 'nouveau message de votre site';
  26. $msg ='nom: '.$name.'<br />'.'Email: '.$email.'<br />'
  27. .'Message:'.nl2br($message);
  28. $headers='From:'.$email."\r\n".'Reply-To: '.$email."\r\n".'Return-Path: '.$email."\r\n".'Content-type: text/html; Charset=iso-8859-1';
  29. mail($to,$subject,$msg,$headers);
  30. print"<b>Merci!</b>";
  32. }
  37. function email_valid ($email) {
  38. if (eregi("^[a-z0-9._-]+@[a-z0-9._-]+.[a-z]{2,4}$", $email))
  39.     { return TRUE; } else { return FALSE; }
  40. }
  41. ?>
May 10 '09 #3
35 New Member
i changed to post method and it kinda solved the problem
May 10 '09 #4
5,390 Recognized Expert Moderator Expert
glad to hear that you got it working ... even when it sounds strange ... did you receive the form's values correctly with GET?

kind regards
May 11 '09 #5
16,027 Recognized Expert Moderator MVP
Rather than using $_REQUEST, use $_GET or $_POST, so you can be sure nothing is overwritten.

According to the PHP code that you posted, only one error message can be printed at a time anyway.
May 11 '09 #6
35 New Member
only the first form validation showed up(enter a name please) then it got stuck there(only for ie), the problem was very strange, the reason might be i am intergrating this into wordpress by trying to by pass everything related to wp, so the post method worked .
May 11 '09 #7

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

Similar topics

by: Jonas | last post by:
This works fine in Win XP but does not work at all in Win 98. Private WithEvents objIExplorer As InternetExplorer I have to do it like this to get it to work in Win 98 Dim objIExplorer As InternetExplorer But then I cant see when a user exit my objIExplorer and than an error will show up when I try to open a link in the IE window that does...
by: me | last post by:
I have a Class Library that contains a Form and several helper classes. A thread gets created that performs processing of data behind the scenes and the Form never gets displayed (it is for debug puposes only and is not normally visable to the user.) The Thread function is actually in the Form class. Now.. What I am seeing is that when I...
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it can be done using the designer but I intentionally don't want to use that. The one reason is that you cannot change the code generated by the...
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be used." Could anybody tell me why gets() function is dangerous?? Thank you very much. Cuthbert
by: webEater | last post by:
I have a problem, it's not browser specific, and I don't get a solution. I have an (X)HTML document, I show you a part of it: .... <!--<div class="pad">--> <div id="eventImages"><img src="" id="eventImage0" class="eventImage"><img src="" id="eventImage1" class="eventImage"></div>
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...
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. ...
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...
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...
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...
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...
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...
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: 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...

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.