...

View Full Version : form post problem



geet40
06-15-2007, 05:20 PM
Hi

New to asp.
Sounds simple but couldnt figure out

I have a asp where a person is given options to choose between manager and advisor and once choosen it returns to the file at exact same point and variables are set based on the value returned.
When I tried to use form submit post to another file, it returns to the start of the file instead of exact place where i want to.


If (M_Access = TRUE) And (A_Access = TRUE) Then

%>
<!-- #include file = "login_option.asp" -->
<%loginoption = request.form("Login")%>
<%
End IF


<!-- MAIN BODY -->

<p><b>Choose your Login Option</b></p>
<form action="auth_inc_login.asp" method="post" name="login">
<input TYPE="radio" NAME="Login" VALUE="MG" CHECKED>Manager
<input TYPE="radio" NAME="Login" VALUE="AD">Advisor
</br>
</br><input type="submit" value="Submit">
</form>
<!-- MAIN BODY END -->

Thanks

glenngv
06-15-2007, 06:28 PM
Try using an anchor.

<form action="auth_inc_login.asp#whatever" method="post" name="login">
Then in auth_inc_login.asp, put this to the location where you want the page to scroll to.

<a name="whatever"></a>

geet40
06-15-2007, 06:45 PM
Hi glenn

Thanks but that is not working

I tried this , its working but i have to click the submit twice to get the form working
couldnt figure out y ?

this is in auth_inc_login.asp

%>
<!-- #include file = "login_option.asp" -->
<%this is in login_option.asp


<html>
<head></head>
<%
Dim Login
Login=Request.Form("Login")
%>
<body>

<p><b>Choose your Login Option</b></p>
<form action="auth_inc_login.asp#topoint" method="post" name="login">
<input TYPE="radio" NAME="Login" VALUE="MG" CHECKED>Manager
<input TYPE="radio" NAME="Login" VALUE="AD">Advisor
</br>
</br><input type="submit" value="Submit">
</form>

<%

IF Login = "MG" Then

Session("sessNtID") = NtID

'set user's access level
access_level = rsData("access_level")
Session("sessAccess_level") = access_level

'set user's ID number
user_id = rsData("user_id")
Session("sessUser_id") = user_id

ElseIf Login ="AD" Then

Session("sessNtID") = NtID

'set user's access level
access_level = asData("access_level")
Session("sessAccess_level") = access_level

'set user's ID number
user_id = asData("user_id")
Session("sessUser_id") = user_id


End If



%>

geet40
06-15-2007, 06:49 PM
the form in previous code (in login_option.asp) is

<form action="" method="post" name="login">

glenngv
06-15-2007, 06:55 PM
You put "#topoint" in the action but you don't have the anchor itself.

<a name="topoint"></a>

geet40
06-15-2007, 06:59 PM
actually i used the topoint and anchor
its not working
its goes to the start of the asp and gives error

what i posted there was the code which works with
action=""
(I corrected that in later post)

In that the problem is i have to click the submit twice to get the form posted
When I choose a radio button and click first time nothing happens
but when i click second time the code is working fine.

geet40
06-15-2007, 09:18 PM
Hi

Not able to get the code to work on single click on submit

Why?
Tried everything(hopefully)

Thanks

glenngv
06-15-2007, 11:20 PM
Can you post a link to the page?

geet40
06-18-2007, 09:55 PM
solved



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum