Jump to content

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

Recommended Posts

Posted

i have a html page with the following code on it

<form action = "fmpro?" method = "post">

<div align="center"><font face="Arial, Helvetica, sans-serif">

<input type = "hidden" name = "-db" value = "alarmcallinglist.fp5">

<input type = "hidden" name = "-lay" value ="web">

<input type = "hidden" name ="-format" value ="alarmlist.htm">

<input type="hidden" name="-find" value=" ">

<INPUT TYPE="hidden" NAME="-Op" VALUE="eq">

Enter Password

<input name = "Password" type = "text" Value="">

&nbsp;

<input name = "-find" type = "submit" name="-find" value= "Find your info">

</center>

</font></div>

</form>

If the passwork field in "wayne" I want the above code to go to another format file.

<input type = "hidden" name ="-format" value ="listview.htm">

How can i change the the top form code to redirect when a specific field value is entered in a field?

Thanks...

Posted

You can use some Javascript:

<script>

function checkForm()

{

if (document.myform.Password.value == "wayne")

{ document.myform.elements["-format"].value = "listview.html"; };

document.myform.submit();

}

</script>

</head>

<body>.....

<form action="fmpro?" method = "post" name="myform" onsubmit="checkForm(); return false;">

<input type = "hidden" name = "-db" value = "alarmcallinglist.fp5">

<input type = "hidden" name = "-lay" value ="web">

<input type = "hidden" name ="-format" value ="alarmlist.htm">

<input type="hidden" name="-find" value=" ">

<INPUT TYPE="hidden" NAME="-Op" VALUE="eq">

Enter Password: <input type="text" name = "Password" Value="">

<input type="hidden" name="-find">

<input type="submit" name="-find" value= "Find your info">

</form>

Good Luck.

Garry

Posted

Hi, bnix! You can also kinda cheat by using the same format file but changing its contents with an IF statement depending upon the password. I'm not sure about the exact syntax of text field references in IF statements, but it would be something like this on your -format page...

[FMP-if: password .eq. wayne]

All your wayne stuff here

[FMP-else]

All your other passwords stuff here

[/FMP-if]

With text fields, I keep forgetting what the syntax is [FMP-if: password .eq. wayne], [FMP-if: field:password .eq. "wayne"], etc. but it's something like that. Now, this solution is not exactly the same thing as having 2 format pages, but it may be good enough for whatever it is you're working on, eh? And if not, maybe someone else reading this post someday will be able to get away w/ just an IF...

--ST

This topic is 7584 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.