Submit data without going to another page

Discussion in 'C#' started by StealthRT, Apr 9, 2008.

  1. #1
    Hey all i am trying to figure out a way to send off my data on my ASP form without having to goto another page to do so. Like once the user clicks on the submit button, an overlay comes on and says "sending data", and in the background it does the same things as it would if it submitted to the page where i have to send the data and stuff.

    Here is some of my form code:
    
    <form action="SendFB.asp" method="POST" name="frmFB">
    <input name="txtFName0" type="text" class="TextBoxes" id="txtFName0" tabindex="1" size="30"  />
    <input name="txtFName1" type="text" class="TextBoxes" id="txtFName1" tabindex="1" size="30"  />
    <input name="txtFName2" type="text" class="TextBoxes" id="txtFName2" tabindex="1" size="30"  />
    <input name="txtFName3" type="text" class="TextBoxes" id="txtFName3" tabindex="1" size="30"  />
    
    ......
    
    <img src="Send.png" alt="" width="260" height="65" id="SubNow" onClick="document.frmFB.submit();"/>
    </form>
    
    Code (markup):
    Now once the user clicks on the button it just sends them to the SendFB.asp page that has the asp code to store the forms values into the database, etc etc.

    So how would i go about just staying on the main page without going to the SendFB.asp page to unload the data to the mySQL database?

    Thanks for your time :)
    David
     
    StealthRT, Apr 9, 2008 IP
  2. Link.ezer.com

    Link.ezer.com Peon

    Messages:
    647
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    0
    #2
    server.Execute("SendFB.asp")
     
    Link.ezer.com, Apr 10, 2008 IP
  3. saurabhj

    saurabhj Banned

    Messages:
    3,459
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This can be done via Ajax. I've done it many times..
     
    saurabhj, Apr 10, 2008 IP
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #4
    if you do not have an action set then the page will post back to itself and you just need a line of code to detect that it is a postback and firstly run the code to process the form and secondly give some form of feedback to the user that the data has been received and processed.
     
    AstarothSolutions, Apr 10, 2008 IP
  5. Amit_Jain

    Amit_Jain Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hi I also have the same problem can anybody solve the prob.?
     
    Amit_Jain, Apr 10, 2008 IP
  6. StealthRT

    StealthRT Peon

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    !nd!an: Can you show me any of your examples?

    David
     
    StealthRT, Apr 10, 2008 IP
  7. InfoSmith

    InfoSmith Peon

    Messages:
    884
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #7
    <iframe id="xxx" name="xxx" .... width=0...


    <form target="xxx"
     
    InfoSmith, Apr 13, 2008 IP
  8. dylanj

    dylanj Peon

    Messages:
    173
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    0
    #8
    Yup, an iFrame would do it, or AJAX (Asynchronous Java And XML).
     
    dylanj, Apr 20, 2008 IP