dschaal Posted February 3, 2003 Posted February 3, 2003 Is there anyway to have an exact search when using the input type password? <INPUT TYPE="password" NAME="fieldname" VALUE="" SIZE=10> When a user puts in a correct password there is no problem returning the list page. When a user puts in the wrong password they get an error page. The problem is when a user accidentally types an * (asterisks). This is a FM database find for zero or more characters.....the user retrieves the entire list and not just their own record. Is there an easy way to prevent this from happening -- using this particular command? Thanks in advance! Donna
Garry Claridge Posted February 4, 2003 Posted February 4, 2003 Try this: <INPUT TYPE="hidden" NAME="-op" VALUE="==" > <INPUT TYPE="password" NAME="fieldname" VALUE="" SIZE=10> All the best. Garry
dschaal Posted February 4, 2003 Author Posted February 4, 2003 I tried your suggestion, but it didn't work. It still retrieve the entire list. This is what I have: <INPUT TYPE="hidden" NAME="-Find" VALUE="=="> <INPUT TYPE="hidden" NAME="FY" VALUE="FY2003"> <INPUT TYPE="hidden" NAME="-op" VALUE="=="> <INPUT TYPE="password" NAME="fieldname" VALUE="" SIZE=10> Would the order make any difference? Any other suggestions?? Thanks!
Unable Posted February 4, 2003 Posted February 4, 2003 <INPUT TYPE="hidden" NAME="-Find" VALUE="=="> <INPUT TYPE="hidden" NAME="FY" VALUE="FY2003"> <INPUT TYPE="hidden" NAME="-op" VALUE="=="> <INPUT TYPE="password" NAME="fieldname" VALUE="" SIZE=10> It appears that you are trying to enter the value "==" into a field named "Find". Change the name of your field if that is the case. From the above it appears that you are trying to search three fields, "Find" and "FY" and a password field which is unnamed and referred to as "fieldname". If you are just trying to make and Exact Field Match of the password, and that password were in a field named "pword", that part of your code could look something like: <INPUT TYPE="hidden" NAME="-op" VALUE="=="> <INPUT TYPE="password" NAME="pword" VALUE="" SIZE=10> OR: <INPUT TYPE="hidden" NAME="pword" VALUE="=="> <INPUT TYPE="password" NAME="pword" VALUE="" SIZE=10>
dschaal Posted February 4, 2003 Author Posted February 4, 2003 The part of my code that states: <INPUT TYPE="hidden" NAME="-Find" VALUE="=="> is a trick I found in the FM knowledge database that makes a Find button accessible either through clicking on the button or pressing the "Enter" key. It works really well. The rest of the code......searches the database and limit the records to FY2003 plus matching the password field. My problem happens only when a user enters an * (astericks) into the password field by mistake. They then retrieve all the records and not just their record. FM sees this as a search request for zero to any characters. So, it retrieves everything. I didn't want to have to put full blown security on it because only a select few even know of its existence. Even if it were hacked into 99.9% of the information is available for public use anyway. No big secrets here. Thanks for trying! Any other suggestions? Donna
Anatoli Posted February 4, 2003 Posted February 4, 2003 You can check for that with JavaScript. Search for form validation...
dschaal Posted February 7, 2003 Author Posted February 7, 2003 I don't know anything about Java.....thanks anyway. Donna
Garry Claridge Posted February 7, 2003 Posted February 7, 2003 Here is a solution which uses some Javascript (no Java): <head> <title>Password</title> <script> function subForm () { if ((document.myform.fieldname.value).indexOf("*") != -1 ) { alert ("Asterisks * are not allowed in the Password!!!"); } else { document.myform.submit(); }; } </script> </head> <body>Enter your Password: <form name="myform" action="FMPro" method="post" onsubmit="subForm(); return false;"> <INPUT TYPE="hidden" NAME="-op" VALUE="=="> <INPUT TYPE="hidden" NAME="FY" VALUE="FY2003"> <INPUT TYPE="hidden" NAME="-op" VALUE="=="> <INPUT TYPE="password" NAME="fieldname" VALUE="" SIZE=10> <INPUT TYPE="hidden" NAME="-Find" VALUE=""> <INPUT TYPE="submit" NAME="-Find" VALUE="Find Records"> </form> </body></html> All the best. Garry
dschaal Posted February 10, 2003 Author Posted February 10, 2003 Thank you! Thank you! Thank you! You rock! Worked like a charm the first time around..... Donna
nati Posted February 28, 2003 Posted February 28, 2003 Hi, I have tried this and the * part works great but I still have the problem with the -op and "==". For the examples, the password field is last name and last 4 digits of the id number. So smith1234. If I use <INPUT TYPE="hidden" NAME="-op" VALUE="=="> <INPUT TYPE="text" NAME="Password" VALUE="" SIZE="20"> <INPUT TYPE="hidden" NAME="-FIND" Value=""> <INPUT TYPE="submit" NAME="-FIND" Value="Search"> then entering smith shows all smith and entering smith* shows "no asterisks allowed". If I use <INPUT TYPE="hidden" NAME="Password" VALUE="=="> (Password instead of -op) <INPUT TYPE="text" NAME="Password" VALUE="" SIZE="20"> <INPUT TYPE="hidden" NAME="-FIND" Value=""> <INPUT TYPE="submit" NAME="-FIND" Value="Search"> then entering smith takes me to -err page but entering smith* doesn't no longer work. Entering smith1234 works in both. Thanks you for help, nati
Garry Claridge Posted February 28, 2003 Posted February 28, 2003 Because you now have two <input> tags named "password" you will have to use a different Javascript method to distinguish them. If the "-op" is not producing an Exact Match you can go to FM, after you attempt a login, and do a "Modify Last Find". This will show what FM was trying to look for. Good Luck. Garry
nati Posted February 28, 2003 Posted February 28, 2003 I have changed the -op to .eq and this seems now to work. thanks, nati
Recommended Posts
This topic is 8277 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