470,631 Members | 1,607 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,631 developers. It's quick & easy.

sliding between forms

hi guys,
I'm new in asp, and hav a question. I have three forms named, read, delete and compose on a single page, it3.asp as .....
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <title>Inbox</title>
  4. <script language="javascript">
  5.  
  6.             function deletemail()
  7.             {    
  8.                 document.read.flag.value="delete";
  9.                 document.read.submit;alert("Delete Selected  Mail?");
  10.                }
  11.             function composemail()
  12.             {
  13.  
  14.                 document.read.flag.value="comp";
  15.                 document.read.submit;alert("Opening Compose Area...");
  16.                }
  17. </script> 
  18. </head>
  19.  
  20.                 <%
  21. dim flg
  22. flg= Request.Form("flag")
  23.  
  24.  
  25. if (flg<>comp and flg<>delete) then
  26.     %>
  27.  
  28.     <body>
  29.     <form name=read  action="it3.asp" method="get">
  30.                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  31.                     - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  32.                    <input type=Submit value=Delete onClick="deletemail()">
  33.                    <input type=Submit value=Compose onClick="composemail()">
  34.  
  35.                     - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  36.                     - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  37.     <input type=text name="flag" style="visibility:hidden">
  38.     </form>
  39.     </body>
  40.  
  41.                 <%
  42. Else  If (flg = delete) Then
  43.     %>
  44.     <body>
  45.     <form name="delete" action="it3.asp" method="get">
  46.                     - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  47.                     - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  48.                   <input type=text name="flag" value="read"style="visibility:hidden" >    
  49.                      </form>
  50.                     </body>
  51.  
  52.                 <%
  53. Else If (flg = comp) then
  54.     %>
  55.  
  56.     %>
  57.     <body>
  58.     <form name="compose" action="it4.asp" method="get">
  59.                     - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  60.                     - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  61.                   <input type=text name="flag" value="read" style="visibility:hidden">    
  62.                      </form>
  63.                     </body>
  64.  
  65. </html>
the problem is I cannot get the flag into the page althought it appears on the adress bar. and also, the if statements dont work.

Thankyou
Jul 29 '07 #1
2 1257
jhardman
3,406 Expert 2GB
a couple of thoughts:

1- I don't think parentheses hurt, but they don't help:
Expand|Select|Wrap|Line Numbers
  1. if flg<>"comp" AND flg<>"delete" then
2- elseif is one word, do not put a space in the middle.

3- you mean to say request("flg") = "comp"? It looks like you are trying to compare a request variable to a string, in which case this is the correct syntax:
Expand|Select|Wrap|Line Numbers
  1. if request("flg")<>"comp" AND request("flg")<>"delete" then
4- it makes more sense to handle the if...else statement in the other order:
Expand|Select|Wrap|Line Numbers
  1. if request("flg") = "comp" then
  2.    ...
  3. elseif requst("flg") = "delete" then
  4.    ...
  5. else
  6.    ...
  7. end if
Let me know if this helps.

Jared
Jul 30 '07 #2
thank you Jared, it worked out. thanks for pointing out the errors.
Sep 4 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Developwebsites | last post: by
2 posts views Thread by Mohammad Parwez | last post: by
1 post views Thread by Guadala Harry | last post: by
2 posts views Thread by Lonewolf | last post: by
1 post views Thread by Lennart | last post: by
4 posts views Thread by piter | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.