Please bear with me... this may get a bit convoluted.
I have a form where I need to replace some data in it. I'm doing this through a javascript function which is launched through an onClick event in a button input type. Once the data is run through the function, I need the page to submit itself and then do stuff to the form data.
I'm running into a problem with getting the page to submit. The function runs properly with the onClick in the button, but after that, it either does nothing or goes to the next stage but wasn't properly submitted as the form items didn't get passed through. Here's the important pieces of code, stored on the page warrantEdit2.asp which is where the submit is directed to as well (if statements directed by the parameters in the URL deal with how to proceed):
So far, I've tried:
* document.forms[0].submit (doesn't do anything)
* document.tracingEdit.submit (doesn't do anything)
* return true (doesn't do anything)
* window.location='warrantEdit2.asp?Action=Tracing&Function=submit' (works, but isn't a proper submit and data from the form elements are lost)
Any ideas on how I can get this to submit properly?
I have a form where I need to replace some data in it. I'm doing this through a javascript function which is launched through an onClick event in a button input type. Once the data is run through the function, I need the page to submit itself and then do stuff to the form data.
I'm running into a problem with getting the page to submit. The function runs properly with the onClick in the button, but after that, it either does nothing or goes to the next stage but wasn't properly submitted as the form items didn't get passed through. Here's the important pieces of code, stored on the page warrantEdit2.asp which is where the submit is directed to as well (if statements directed by the parameters in the URL deal with how to proceed):
Code:
<SCRIPT LANGUAGE="JavaScript">
function testResults (form)
{
for(i = 0; i < document.forms[0].elements.length; i++)
{
alert(document.forms[0].elements[i].value.replace(/,/, ","))
}
document.forms[0].submit
}
</SCRIPT>
<form name="tracingEdit" action="warrantEdit2.asp?Action=Tracing&Function=submit" method="post">
Elements and stuff
<input type="button" name="submit" value="Submit Changes" onClick="testResults(this.form)">
</form>
So far, I've tried:
* document.forms[0].submit (doesn't do anything)
* document.tracingEdit.submit (doesn't do anything)
* return true (doesn't do anything)
* window.location='warrantEdit2.asp?Action=Tracing&Function=submit' (works, but isn't a proper submit and data from the form elements are lost)
Any ideas on how I can get this to submit properly?