DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: form data

  1. #1
    SPST Guest

    form data


    My page gets data from two tables(say).
    tbl A, tbl B

    After the user inserts/updates the form data in one table(tblA) through an
    user form, the data has to be copied to the second table(tblA)
    which also shows up in the same page as a display form.

    e.g onces the user enter's the end date on the frm1, the data gets copied
    to the tblB and also displays on the frm2

    Need help please.



  2. #2
    Tommy Guest

    Re: form data


    Use the submit method of your form. Frm.Submit... On the action page(the
    page to which you submit the form), you can use server-side code to write
    to the database, and display the info on the page. Of course it is better
    to separate out the code into business objects and data access layers...
    so bear this in mind.

    e.g.

    <FORM NAME="fromFORM" METHOD="POST" ACTION="toForm">
    --whatever it is you are getting comes from this form
    </FORM>

    <script>
    fromForm.submit
    </script>

    ---------------------
    <%@ language=vbscript%>
    'get variables from fromForm
    Request.Form("variables")

    'instantiate your business object, or use ADO on this page
    'to connect to your db and do your inserts
    Set ds=Server.CreateObject("businessObject.clsInsert")
    blnSuccess=ds.UpdateYourTable(var1,var2...varN)
    Set ds=Nothing

    'Now display info on this page
    Response.Write var1, var2...., varN


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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

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