Jump to content

This topic is 8008 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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!

Posted

<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>

Posted

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

Posted

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

  • 3 weeks later...
Posted

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

Posted

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

This topic is 8008 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.