Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Jun 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    form post problem

    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.

    Code:
    If (M_Access = TRUE) And (A_Access = TRUE) Then
            
                %>
                    <!-- #include file = "login_option.asp" -->
                    <%loginoption = request.form("Login")%>
                <%
    End IF
    Code:
     <!-- 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

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Try using an anchor.
    Code:
    <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.
    Code:
    <a name="whatever"></a>
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    New Coder
    Join Date
    Jun 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Code:
    %>
                    <!-- #include file = "login_option.asp" -->
                <%
    this is in login_option.asp

    Code:
    <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
                            
                        
        
                            %>

  • #4
    New Coder
    Join Date
    Jun 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the form in previous code (in login_option.asp) is
    Code:
    <form action="" method="post" name="login">

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    You put "#topoint" in the action but you don't have the anchor itself.
    Code:
    <a name="topoint"></a>
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #6
    New Coder
    Join Date
    Jun 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #7
    New Coder
    Join Date
    Jun 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi

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

    Why?
    Tried everything(hopefully)

    Thanks

  • #8
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Can you post a link to the page?
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #9
    New Coder
    Join Date
    Jun 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts
    solved


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •