DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Auto submit form

  1. #1
    Join Date
    May 2010

    Auto submit form

    Hi there,

    What I want to do is that:

    I make a link ( <a href=...) with the following address
    When I press on this link the asp page redirects me to this page:

    I mean that I want to submit data automatically to the form on this page

    Is there a way to do this?

    Thank you.

  2. #2
    Join Date
    Oct 2008

    submit to an page or form in general

    hi there,

    for page i found it uses "post" method, so you have to use such method to submit this form, which it looks to be different from your other page because your other page accepts a query string, which you constructed and worked well. if a web script is submitted with a "get" method then you can send a query string to this web script. however, if a web script is submitted via post method then you have to use something different. we have been able to do this at the office because we found the solution by web searching. we used easyHttp class, which you can find here
    the parameters you need to send look to be (from the source code of that page):

    -- beginning of input parameters to submit your search page --

    <input name="ctl00$BodyContent$VBPinSearch1$Area" type="text" maxlength="2" id="ctl00_BodyContent_VBPinSearch1_Area" title="Area" class="pinsearchfieldslarge" OnKeyUp="javascript:HandleOnKeyUp(ctl00_BodyContent_VBPinSearch1_Area,2,ctl00_BodyContent_ VBPinSearch1_SubB)" style="width:33px;" />
    <input name="ctl00$BodyContent$VBPinSearch1$SubB" type="text" maxlength="2" id="ctl00_BodyContent_VBPinSearch1_SubB" title="Sub" class="pinsearchfieldslarge" OnKeyUp="javascript:HandleOnKeyUp(ctl00_BodyContent_VBPinSearch1_SubB,2,ctl00_BodyContent_ VBPinSearch1_Blk)" style="width:33px;" />
    <input name="ctl00$BodyContent$VBPinSearch1$Blk" type="text" maxlength="3" id="ctl00_BodyContent_VBPinSearch1_Blk" title="Blk" class="pinsearchfieldslarge" OnKeyUp="javascript:HandleOnKeyUp(ctl00_BodyContent_VBPinSearch1_Blk,3,ctl00_BodyContent_V BPinSearch1_Par)" style="width:50px;" />
    <input name="ctl00$BodyContent$VBPinSearch1$Par" type="text" maxlength="3" id="ctl00_BodyContent_VBPinSearch1_Par" title="Par" class="pinsearchfieldslarge" OnKeyUp="javascript:HandleOnKeyUp(ctl00_BodyContent_VBPinSearch1_Par,3,ctl00_BodyContent_V BPinSearch1_Unit)" style="width:50px;" />
    <input name="ctl00$BodyContent$VBPinSearch1$Unit" type="text" maxlength="4" id="ctl00_BodyContent_VBPinSearch1_Unit" title="Unit" class="pinsearchfieldslarge" OnKeyUp="javascript:HandleOnKeyUp(ctl00_BodyContent_VBPinSearch1_Unit,4,ctl00_BodyContent_ VBPinSearch1_SearchButton)" style="width:65px;" />

    <select name="ctl00$BodyContent$VBPinSearch1$ClassSel3" onchange="javascript:setTimeout('__doPostBack(\'ctl00$BodyContent$VBPinSearch1$ClassSel3\' ,\'\')', 0)" id="ctl00_BodyContent_VBPinSearch1_ClassSel3" class="pinsearchfields" style="font-size:12px;width:500px;">

    <select name="ctl00$BodyContent$VBPinSearch1$ClassSel4" onchange="javascript:setTimeout('__doPostBack(\'ctl00$BodyContent$VBPinSearch1$ClassSel4\' ,\'\')', 0)" id="ctl00_BodyContent_VBPinSearch1_ClassSel4" class="pinsearchfields" style="font-size:12px;width:600px;">

    -- end of input parameters to submit your search page --

    my guess is that out of these six parameters, this search.aspx is expecting only five, meaning only one the last two parameters (input fields).
    i know right now it looks confusing, but as you read about easyHttp it will all be clear to you.

    good luck,

    tonci korsano "what you think doesn't matter! what matters is evidence..."

  3. #3
    Join Date
    May 2010
    "What would be the use of it? No user had a chance to enter data, so it must be you to prefill the form. The data for prefilling are already known to you, so why send them?" response is this:

    I'm using a thrid-party web-service for auto-response e-mail and newsletter services.

    Normally a user enters their info into a form and clicks submit. This gets sent to the third-party who send my user back to my site to a pre-defined landing page set by me (i.e. thankyou.php)

    Thing is, I'm trying to take my data-collection to another level!

    I have a new-user registration form, part of which is the classic 'Tick here to get our newsletter'

    When they submit the form, all of their data is inserted into MY database for my use for everything my web-system is doing, but if 'optIN' is set to 1, I send them to an invisible page that sends their name and e-mail to the third-party, who then sends the usr back invisibly... nice!

Similar Threads

  1. Auto scaling of controls in a form (.Net 2008).
    By priyamtheone in forum .NET
    Replies: 2
    Last Post: 04-15-2010, 01:43 PM
  2. Replies: 0
    Last Post: 11-20-2006, 02:46 AM
  3. Replies: 0
    Last Post: 08-09-2003, 02:06 AM
  4. submit form & open page with 1 button
    By Gregg in forum Architecture and Design
    Replies: 1
    Last Post: 05-17-2001, 11:44 AM
  5. how to determine what Form to Submit
    By RAJ in forum ASP.NET
    Replies: 2
    Last Post: 06-17-2000, 03:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center