Hi All,
I have a problem with IE reloading after a simple function is executed. The problem occurs after the data is sent to the input element in a form. Here is the code for the form:
<div id="mailBody">
<form id="frmMailBody" action="../php/mailer.php" method="post" onSubmit="return chkForm(this)">
<p><a href="#" onclick="getData('../php/addressbook_ajax.php');showMe('addressBook')">To</a>: <input name="to" id="to" value="" type="text" /></p>
<p><a href='#' onclick="showMe('fromAddy')">From:</a> <input name="from" id="from" value="<? echo $_SESSION['email']; ?>" ></p>
<p><textarea style="width:400px; height:200px; overflow:auto" name="body"></textarea></p>
<p><input type="submit" name="submit" value="Submit"><input type="reset" value="Clear"></p>
</form>
</div>
Here is the JS code:
function selectAddresses(){
var inputElements=document.getElementsByTagName("input");
var toEmail=document.getElementById("to");
var toEmailValue=toEmail.value;
for(i=0;i<inputElements.length;i++){
if(inputElements[i].getAttribute('type')=='checkbox'){
if(inputElements[i].checked){
//alert(inputElements[i].value);
//alert(inputElements[i].getAttribute('value'));
if(toEmailValue==""){
toEmailValue=inputElements[i].value;
}else{
toEmailValue=toEmailValue+";"+inputElements[i].value;
}
}
}
}
toEmail.value=toEmailValue;
hideMe("addressBook");
}
I don't know if anyone else had this problem with IE. The code works like magic in Chrome and FireFox. So I do not know what would cause IE to reload.
Thanks for any input.
Max.
------------------------------------
Visit http://aiaiai.com for more groups to joinYahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/JavaScript_Official/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/JavaScript_Official/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:JavaScript_Official-digest@yahoogroups.com
mailto:JavaScript_Official-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
JavaScript_Official-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/