Cameron Posted September 22, 2015 Report Share Posted September 22, 2015 Hi everyone, I am creating a catalog of books. I have a Submission form, and one of my questions is "Is the same book already added to the catalog?", it is a check-box form element. If a user checks the checkbox, I want to display an error message "Please don't duplicate books" and if a user clicks the Submit button, I want to display another error message "Because the same books is already added to the catalog, please don't duplicate books". I believe, it is possible in Caspio but I cannot find the script in the forum. Thank you for your time! Quote Link to comment Share on other sites More sharing options...
Aurora Posted September 22, 2015 Report Share Posted September 22, 2015 Hello Cameron! Hope you are doing well. I have suggestion, which might help you . When a User selects No, he will receive a warning message and a Submit Button will be disabled. Then, if he selects Yes, a Submit Button will appear again. There is a script: <SCRIPT LANGUAGE="JavaScript"> function MyFunction() { if (document.getElementById('InsertRecordYes_No').checked) { document.getElementById("Submit").style.display = "none"; alert(" You cannot submit a form. Please select NO "); return false; } else { document.getElementById("Submit").style.display = "inline"; } } document.getElementById('caspioform').onchange=MyFunction; </SCRIPT> I hope it is what you need. Best, Aurora Quote Link to comment Share on other sites More sharing options...
DataCobalt Posted September 23, 2015 Report Share Posted September 23, 2015 Hi Cameron, Does the user have to enter any kind of code that would be unique to each book? If so you can mark it as a unique field and people will be unable to save entries with duplicates. Quote Link to comment Share on other sites More sharing options...
Cameron Posted October 1, 2015 Author Report Share Posted October 1, 2015 I hope it is what you need. Aurora Hello Aurora! Wow! It is perfect! Thank you for your time! Hi Cameron, Does the user have to enter any kind of code that would be unique to each book? If so you can mark it as a unique field and people will be unable to save entries with duplicates. Hi DataCobalt! Thank you for your time and for your advice! Yes, it is ISBN. But if the book is published by another publisher, it has another ISBN, but in fact it is the same book, I mean, the author and the content are the same. Maybe, I need to invent some unique id for books. Thank you! 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.