it works perfect on safari and ff but not on ie,any thoughts?, thanks for your help - function xhr(){
-
var xmlHttp=null;
-
try{xmlHttp=new XMLHttpRequest();}
-
catch (e){
-
try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
-
catch (e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
-
}
-
}
-
return xmlHttp;
-
}
-
-
-
valid=new xhr();
-
function validation(){
-
var nom=document.forms.recommander_ce_blog.nom.value;
-
var email=document.forms.recommander_ce_blog.email.value;
-
var message=document.forms.recommander_ce_blog.message.value;
-
valid.onreadystatechange = alertContents;
-
valid.open('get',"validation_recommander_ce_blog.php?nom="+nom+"&email="+email+"&message="+message+"&id="+Math.random(), true);
-
valid.setRequestHeader('If-Modified-Since','Wed, 05 Apr 2006 00:00:00 GMT');
-
valid.send(null);
-
-
}
-
function alertContents(){
-
if (valid.readyState == 4) {
-
result = valid.responseText;
-
var div=document.getElementById('recommander_ce_blog_error_message')
-
div.innerHTML = result;
-
if (div.innerHTML=="<b>Merci!</b>"){
-
document.getElementById("recommander_ce_blog").style.display="none";
the form: - <form action="javascript:validation()" id="recommander_ce_blog" name="recommander_ce_blog" >
-
<table style="height: 148px;" border="0" width="282">
-
<tr>
-
<td>nom:</td>
-
<td><input name="nom" type="text" /></td>
-
</tr>
-
<tr>
-
<td>email:</td>
-
<td><input name="email" type="text" /></td>
-
</tr>
-
<tr>
-
<td valign="top">message:</td>
-
<td><textarea name="message"></textarea></td>
-
</tr>
-
<tr>
-
<td></td>
-
<td><input name="submit_recommander_ce_blog" type="submit" value="Submit" /></td>
-
</tr>
-
</table>
-
</form>
6 1531 gits 5,390
Expert Mod 4TB
what exactly is not working in IE?
kind regards
on ie i only get the first php validation error(nom wich is name) and it stuck there
php validation code: -
<?php
-
Header('Cache-Control: no-cache');
-
Header('Pragma: no-cache');
-
-
$nom=$_REQUEST["nom"];
-
$email=$_REQUEST["email"];
-
$message=$_REQUEST["message"];
-
-
-
if(trim($nom)==""){
-
print("un nom svp");
-
}
-
else if(trim($email)==""){
-
print("un mail svp");
-
}
-
else if(!email_valid($email)){
-
print("un mail valide svp");
-
}
-
else if(trim($message)==""){
-
print("un message svp");
-
}
-
else{
-
-
$to='dddd@gmail.com';
-
$subject = 'nouveau message de votre site';
-
$msg ='nom: '.$name.'<br />'.'Email: '.$email.'<br />'
-
.'Message:'.nl2br($message);
-
$headers='From:'.$email."\r\n".'Reply-To: '.$email."\r\n".'Return-Path: '.$email."\r\n".'Content-type: text/html; Charset=iso-8859-1';
-
mail($to,$subject,$msg,$headers);
-
print"<b>Merci!</b>";
-
-
}
-
-
-
-
-
function email_valid ($email) {
-
if (eregi("^[a-z0-9._-]+@[a-z0-9._-]+.[a-z]{2,4}$", $email))
-
{ return TRUE; } else { return FALSE; }
-
}
-
?>
i changed to post method and it kinda solved the problem
gits 5,390
Expert Mod 4TB
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
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.
@gits
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 .
regards
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...
|
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...
|
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...
|
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...
|
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=""...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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: 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...
|
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,...
| |