ChrisGoode Posted February 15, 2017 Report Share Posted February 15, 2017 Our database was created before formulas were allowed in tables. Due to relationships, table restrictions and being live, I would like to fix this without using formulas. I have a submit form that is creating a Work Order Number by concatenating the Equipment_VIN and Time Stamp. In the form the Equipment_VIN is chosen by drop drop down from an equipment table. The form works perfectly. When I change the Equipment_VIN to autocomplete so the VIN numbers are easier to find the element of the VIN is no longer pulled by the script. Anyone have an idea as to why this is happening? Here is the script I am running in the footer. The script points to an HTML block div that is called "won" for work order number. <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var position1 = document.getElementById("InsertRecordEquipment_VIN").value; var position2 = '[@cbTimestamp]'; var allpositions = position1 +" "+ position2; document.getElementById("InsertRecordWork_Order_Number").value = allpositions; document.getElementById("won").innerHTML= "Work Order Number is: " + allpositions; } document.getElementById("Submit").onmouseover=concatenate; </SCRIPT> Quote Link to comment Share on other sites More sharing options...
Mathilda Posted February 15, 2017 Report Share Posted February 15, 2017 2 hours ago, ChrisGoode said: Our database was created before formulas were allowed in tables. Due to relationships, table restrictions and being live, I would like to fix this without using formulas. I have a submit form that is creating a Work Order Number by concatenating the Equipment_VIN and Time Stamp. In the form the Equipment_VIN is chosen by drop drop down from an equipment table. The form works perfectly. When I change the Equipment_VIN to autocomplete so the VIN numbers are easier to find the element of the VIN is no longer pulled by the script. Anyone have an idea as to why this is happening? Here is the script I am running in the footer. The script points to an HTML block div that is called "won" for work order number. <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var position1 = document.getElementById("InsertRecordEquipment_VIN").value; var position2 = '[@cbTimestamp]'; var allpositions = position1 +" "+ position2; document.getElementById("InsertRecordWork_Order_Number").value = allpositions; document.getElementById("won").innerHTML= "Work Order Number is: " + allpositions; } document.getElementById("Submit").onmouseover=concatenate; </SCRIPT> Since Equipment_VIN is an autocomplete field, try using another syntax for getting value: var position1 = document.getElementsByName("InsertRecordEquipment_VIN")[0].value; Hope it helps Quote Link to comment Share on other sites More sharing options...
ChrisGoode Posted February 15, 2017 Author Report Share Posted February 15, 2017 That works. Thank you so much, and I learned something which makes it even better. Quote Link to comment Share on other sites More sharing options...
Mathilda Posted February 15, 2017 Report Share Posted February 15, 2017 1 hour ago, ChrisGoode said: That works. Thank you so much, and I learned something which makes it even better. Great! You're welcome Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.