originalxavier
Programmer
Hello,
I have a form that I am using to update records. The problem is this... I want users to be able to add comments to what is already there but not delete them. I have been able to join the two fields "originalcomments" and the new comments "IRM_.._COMMENTS". But with the way I have the code below, it will not submit the data. It will join the fields properly and give me the alert, but nothing will be updated and it will redirect you as it should
Without the JavaScript, the update code worked fine. I was able to have dynamic fields where users could modify the data, and update it. But with the code below... It will not do the actual updating.
If I change the onclick to onsubmit, the JavaScript will not work and it still will not update.
THE CODE:
<head>
<title>Update Information</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="JavaScript">
function combine() {
if (form1.IRM_BIENNIAL_COMMENTS.value.length > 0) {
alert("Something is there!"
var text = form1.OriginalComment.value + " " + form1.IRM_BIENNIAL_COMMENTS.value;
form1.CombinedComment.value = text;
}
return true;
}
</script>
</head>
...
<form ACTION="<%=MM_editAction%>" method="POST" name="form1">
(THE FORM IS HERE)
<input name="submit" type="submit" value="Update Record" onclick="return combine()" />
Let me know if more info is needed.
Thanks,
Xavier
----------------------------------------
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far the Universe is winning."
Rick Cook
----------------------------------------
I have a form that I am using to update records. The problem is this... I want users to be able to add comments to what is already there but not delete them. I have been able to join the two fields "originalcomments" and the new comments "IRM_.._COMMENTS". But with the way I have the code below, it will not submit the data. It will join the fields properly and give me the alert, but nothing will be updated and it will redirect you as it should
Without the JavaScript, the update code worked fine. I was able to have dynamic fields where users could modify the data, and update it. But with the code below... It will not do the actual updating.
If I change the onclick to onsubmit, the JavaScript will not work and it still will not update.
THE CODE:
<head>
<title>Update Information</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="JavaScript">
function combine() {
if (form1.IRM_BIENNIAL_COMMENTS.value.length > 0) {
alert("Something is there!"
var text = form1.OriginalComment.value + " " + form1.IRM_BIENNIAL_COMMENTS.value;
form1.CombinedComment.value = text;
}
return true;
}
</script>
</head>
...
<form ACTION="<%=MM_editAction%>" method="POST" name="form1">
(THE FORM IS HERE)
<input name="submit" type="submit" value="Update Record" onclick="return combine()" />
Let me know if more info is needed.
Thanks,
Xavier
----------------------------------------
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far the Universe is winning."
Rick Cook
----------------------------------------