Results 1 to 7 of 7

Thread: Button value on form

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2004
    Posts
    182

    Button value on form

    I have code that is connecting to a database and loading a recordset. The recordset is loaded depending on the button that is clicked. So I say
    <%
    if document.form.value="Add" then
    load recordet(add)
    else
    load recordet(edit)
    end if
    %>

    I keep getting an error that says that document property can not be found. Is there anyway to reference the button??

  2. #2
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    save this as any asp file and try it.

    VB Code:
    1. <%
    2.  
    3. dim btn
    4.  
    5. bttn= Request.form("ButtonClicked")
    6.  
    7. if bttn="Add" then
    8.     response.write "you pressed add button<br>"
    9. elseif bttn="Edit" then
    10.     response.write "you pressed edit button<br>"
    11. end if
    12. %>
    13.  
    14. <head>
    15. <script>
    16.  
    17. function SetClick(v)
    18. {
    19.     document.form1.buttonclicked.value=v;
    20.  
    21.  
    22.     document.form1.submit();
    23. }
    24. </script>
    25. </head>
    26. Click one of the Button !
    27. <form name=form1 action="" method=post>
    28. <input type=hidden name=buttonclicked>
    29. <input type=button name=Add value=Add onclick="javascript:SetClick('Add');">
    30. <input type=button name=Edit value=Edit  onclick="javascript:SetClick('Edit');">
    31. </form>
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2004
    Posts
    182
    Thanks! It worked!

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Mar 2004
    Posts
    182

    Close form

    I have a link on the form and when the user clicks on a link the pop up comes up and asks a few questions then when they press submit I want the popup to close and the parent form to be filled with the values they entered.

    How do I close the popup window and then load thoses values into the parent form?

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Mar 2004
    Posts
    182

    Help Menu

    Anyone created a help menu for an asp page?

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Mar 2004
    Posts
    182

    Sum of text boxes

    I have 4 text boxes in a colmn and a total box at the end. The total box will be the sum of the values in textboxes 1-4. How do I get the total box to sum when alues are added or changed in any of the four boxes?

  7. #7
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: Sum of text boxes

    Originally posted by realgoldn
    I have 4 text boxes in a colmn and a total box at the end. The total box will be the sum of the values in textboxes 1-4. How do I get the total box to sum when alues are added or changed in any of the four boxes?

    I guess i have answered your question in your other thread.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

Posting Permissions

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



Click Here to Expand Forum to Full Width