the walker Posted November 22, 2002 Share Posted November 22, 2002 just a quick question is there any way i can make a text field mandatory for a user to fill in before they can submit a form for an edit or search Cheers Link to comment Share on other sites More sharing options...
Steve T. Posted November 22, 2002 Share Posted November 22, 2002 Hi, Walker! I think this Q comes up often, especially wrt login/password systems. I believe the answer is "yes" and it can be done with JavaScript or FMP/CDML. If no one gives you code right away, search previous posts... --ST Link to comment Share on other sites More sharing options...
Garry Claridge Posted November 22, 2002 Share Posted November 22, 2002 Here is an example: This Javascript goes between the <head.. tags: <script> function checkField() { if (document.myform.myfield.value) == "") { alert("Field cannot be empty") ; } else { document.myform.submit() ; } ; } ; </script> This is your form:<form name="myform" action="FMPro" method="post" onsubmit="checkField(); return false;"> . . Enter Field:<input type="text" name="myField" value=""> <input type="button" value="Find" onclick="checkField();"> </form> Hope this helps. Garry Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 7953 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now