Moritz Posted December 12, 2017 Report Share Posted December 12, 2017 Hello, I need some help to automate my form. I use an Bar code scanner which puts an "enter" after the scanned code Both SN (serial numbers) must be the same My process should be the following; User: scan SN1 (bar code) + enter signal form bar code scanner System: verify the SN (should have 10 characters) If correct set focus to SN2 If not correct remove remove input from SN1 User: scan SN2 (bar code) + enter signal form bar code scanner System: verify the SN2 (should have 10 characters) If not correct remove remove input from SN1 Verify if SN1 and SN2 the same If not give user warning (remove the both SN1 and SN2 input) if yes enter foam I would appreciate any help how I can realize this. Thank you in advance Quote Link to comment Share on other sites More sharing options...
Moritz Posted December 12, 2017 Author Report Share Posted December 12, 2017 Hello, I got it working to some level: <script type="text/javascript"> function stopRKey(evt) { var evt = (evt) ? evt : ((event) ? event : null); var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if ((evt.keyCode == 13) && (node.type=="text")) { sn1 = document.getElementById("InsertRecordSN1").value sn2 = document.getElementById("InsertRecordSN2").value if (!(sn1.length==10 && sn2.length==10 && sn1==sn2)){ return false; } } } function focussn2() { sn1 = document.getElementById("InsertRecordSN1").value if (sn1.length==10){ document.getElementById("InsertRecordSN2").focus(); } } document.getElementById("Submit").style.display = "none"; document.getElementById("InsertRecordSN1").focus(); document.onkeypress = stopRKey; document.getElementById("InsertRecordSN1").onkeyup = focussn2; </script> 1. Issue: document.getElementById("Submit").style.display = "none"; will break my code and it does not hide the Submit button 2. Issue I would like to have warning (maybe some text in red letters) inside the submission foam until my conditions are met. I know I can use the alert function but i dont want to use an pop up. Thank you very much for your help Quote Link to comment Share on other sites More sharing options...
Vitalikssssss Posted December 15, 2017 Report Share Posted December 15, 2017 Hi Moritz, 1. You can hide submit button by placing following CSS code in Datapage header. <style> .cbSubmitButton { display:none; } </style> 2. You can use an HTML block and display the message via innerHTML Property. Hope this helps. Regards, vitalikssssss 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.