|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Auto submit
I am trying to automatically submit for2 to a FileMaker Pro Server. Here is my code: It only refreshes the page and clear the fields. Any help is appreciated.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <TITLE>Lumigen Chemical Receiving</TITLE> <script><!-- function setFocus() { document.form1.barcode.focus(); } function enterbarcode() { var barcode = document.form1.barcode.value; var supplierCode = barcode.substring(0,4); var catNo = barcode.substring(4,10); var emdCatNo = barcode.substring(4,13); if (supplierCode != "") { if (supplierCode == "h479") { document.form2.CatNo.value=catNo; document.form2.submit(); alert("submit"); } else if (supplierCode == "h650" ) { document.form3.CatNo.value=emdCatNo; document.form3.submit(); } else if (supplierCode == "h999" ) { document.form4.CatNo.value=catNo; document.form4.submit(); } else { alert("This Barcode is invalid") } } else { alert("You did not enter a value") } } // Stop hiding --> </SCRIPT> </HEAD> <BODY onload="setFocus()"> <p><FORM method="post" onsubmit="enterbarcode()" name="form1"> <INPUT type="text" name="barcode"> </FORM></p> <p><FORM action="FMPro" method="post" id="form2" name="form2"> <P><INPUT TYPE="hidden" NAME="-db" VALUE="BAKERBarcodeData"> <INPUT TYPE="hidden" NAME="-lay" VALUE="BakerRecordData"> <INPUT TYPE="hidden" NAME="-format" VALUE="Results.html"> <INPUT TYPE="hidden" NAME="-error" VALUE="checkinverror.html"> <INPUT name="CatNo" type="text"> <INPUT TYPE="hidden" NAME="-find" VALUE="Start Search"> </FORM></p> <p><FORM action="FMPro" method="post" id="form3" name="form3"> <P><INPUT TYPE="hidden" NAME="-db" VALUE="EMDBarcodeData"> <INPUT TYPE="hidden" NAME="-lay" VALUE="EMD"> <INPUT TYPE="hidden" NAME="-format" VALUE="Results.html"> <INPUT TYPE="hidden" NAME="-error" VALUE="checkinverror.html"> <INPUT type="text" name="CatNo"> <INPUT TYPE="hidden" NAME="-find" VALUE="Start Search"> </FORM></p> <p><FORM action="FMPro" method="post" id="form4" name="form4"> <P><INPUT TYPE="hidden" NAME="-db" VALUE="LumigenBarcodeData"> <INPUT TYPE="hidden" NAME="-lay" VALUE="LumigenRecordLayout"> <INPUT TYPE="hidden" NAME="-format" VALUE="Results.html"> <INPUT TYPE="hidden" NAME="-error" VALUE="checkinverror.html"> <INPUT type="text" name="CatNo"> <INPUT TYPE="hidden" NAME="-find" VALUE="Start Search"> </FORM></p> </BODY> </HTML> |
|
#2
|
||||
|
||||
|
form submit
The forms action's are FMPro, I think it should be pointing to a file somewhere, not a name. eg.
action="http://www.myserver.com/fmpro.cgi" |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Auto submit |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|