questhaven
Programmer
Hi there - I am so frustrated! For the life of me I cant figure out why this code works on my PC (both IE and Netscape) - but does not work on IE5 for the Mac. I am simply trying to submit a form. I am fairly new to javascript and below I have included the code. Any help would be appreciated!
<script language="JavaScript">
// adds an attachment based on form values
function attachmentEvent() {
if(document.NoteForm.attachmentStatus.value=='new') {
addAttachment(document.NoteForm.attachmentContent.value, document.NoteForm.attachmentType.value);
}
if(document.NoteForm.attachmentStatus.value=='edit') {
editAttachment(document.NoteForm.attachmentId.value, document.NoteForm.attachmentContent.value, document.NoteForm.attachmentType.value);
}
if(document.NoteForm.attachmentStatus.value=='delete') {
removeAttachment(parseInt(document.NoteForm.attachmentId.value) + 1);
}
document.NoteForm.attachmentContent.value = '';
document.NoteForm.attachmentType.value = '';
document.NoteForm.attachmentStatus.value = '';
document.NoteForm.attachmentId.value = '';
}
// adds the attachment content, type and changes the image
function addAttachment(content, aType) {
for(x=0;x<aList.length;x++) {
if(aList[x]=='') {
aList[x]=content;
tList[x]=aType;
changeImage(x+1, aType);
break;
}
}
}
function editAttachment(i, content, aType) {
aList=content;
tList=aType;
}
// fills form fields from array
function fillForm() {
if (browserName == "Microsoft Internet Explorer"
for(x=0; x < aList.length; x++) {
document.getElementById('aContent' + (parseInt(x)+1)).value = aList[x];
document.getElementById('aType' + (parseInt(x)+1)).value = tList[x];
}
document.NoteForm.submit();
}
</SCRIPT>
<form NAME="NoteForm" ID="NoteForm" method="POST" action="note_add.asp">
<textarea STYLE="width:100%" rows="9" ID="message" name="message" cols="21" onKeyDown="textCounter(this.form.message,this.form.remLen);" wrap=physical onKeyUp="textCounter(this.form.message,this.form.remLen);"><%=templateContent%>
<script language="JavaScript">
// adds an attachment based on form values
function attachmentEvent() {
if(document.NoteForm.attachmentStatus.value=='new') {
addAttachment(document.NoteForm.attachmentContent.value, document.NoteForm.attachmentType.value);
}
if(document.NoteForm.attachmentStatus.value=='edit') {
editAttachment(document.NoteForm.attachmentId.value, document.NoteForm.attachmentContent.value, document.NoteForm.attachmentType.value);
}
if(document.NoteForm.attachmentStatus.value=='delete') {
removeAttachment(parseInt(document.NoteForm.attachmentId.value) + 1);
}
document.NoteForm.attachmentContent.value = '';
document.NoteForm.attachmentType.value = '';
document.NoteForm.attachmentStatus.value = '';
document.NoteForm.attachmentId.value = '';
}
// adds the attachment content, type and changes the image
function addAttachment(content, aType) {
for(x=0;x<aList.length;x++) {
if(aList[x]=='') {
aList[x]=content;
tList[x]=aType;
changeImage(x+1, aType);
break;
}
}
}
function editAttachment(i, content, aType) {
aList=content;
tList=aType;
}
// fills form fields from array
function fillForm() {
if (browserName == "Microsoft Internet Explorer"
for(x=0; x < aList.length; x++) {
document.getElementById('aContent' + (parseInt(x)+1)).value = aList[x];
document.getElementById('aType' + (parseInt(x)+1)).value = tList[x];
}
document.NoteForm.submit();
}
</SCRIPT>
<form NAME="NoteForm" ID="NoteForm" method="POST" action="note_add.asp">
<textarea STYLE="width:100%" rows="9" ID="message" name="message" cols="21" onKeyDown="textCounter(this.form.message,this.form.remLen);" wrap=physical onKeyUp="textCounter(this.form.message,this.form.remLen);"><%=templateContent%>