Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

forms

Options
  • 26-05-2011 10:59am
    #1
    Closed Accounts Posts: 10


    Hi,

    here's what im trying to do. create a test script form on a html page. once the form completed a submit button sends data to a database. now i know i need a scripting language and my question is which way would be best to go with what i have done so far. here's what ive done so far:

    < !DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    < html>
    < head>
    < title>Test Script</title>

    <h2> Presentation </h2>
    </head>
    <body>
    <form name="form1" action="add_to_database.asp" method="post">
    Project: <input type="text" name="Project" /><br />
    Version: <input type="text" name="Version" /><br/>
    Date: <input type="text" name="Date" />
    <table>
    <tr>
    <th colspan="1"> Task </th>
    <th colspan="1"> Action </th>
    <th colspan="1"> Expected</br>Result </th>
    <th colspan="1"> Actual</br>Result </th>
    <th colspan="1"> Tester</br>Comments </th>
    <th colspan="1"> Tester </th>
    <th colspan="2"> Pass-Y/N </th>
    </tr>
    <tr>
    <td><textarea rows="5" cols="20" id="task1">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="action1">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="expected1">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="actual1">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="testercomments1">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="tester1">
    </textarea></td>
    <td>
    < select name="Y/N">
    < option value="Y">Y</option>
    < option value="N">N</option></td>
    </tr>
    <tr>
    <td><textarea rows="5" cols="20" id="task2">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="action2">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="expected2">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="actual2">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="testercomments2">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="tester2">
    </textarea></td>
    <td>
    < select name="Y/N">
    < option value="Y">Y</option>
    < option value="N">N</option></td>
    </tr>
    <td><textarea rows="5" cols="20" id="task3">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="action3">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="expected3">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="actual3">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="testercomments3">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="tester3">
    </textarea></td>
    <td>
    < select name="Y/N">
    < option value="Y">Y</option>
    < option value="N">N</option></td>
    </tr>
    < /table>
    < h2> Functionality </h2>
    <table>
    <tr>
    <th colspan="1"> Task </th>
    <th colspan="1"> Action </th>
    <th colspan="1"> Expected</br>Result </th>
    <th colspan="1"> Actual</br>Result </th>
    <th colspan="1"> Tester</br>Comments </th>
    <th colspan="1"> Tester </th>
    <th colspan="1"> Pass-Y/N </th>
    </tr>
    <td><textarea rows="5" cols="20" id="task4">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="action4">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="expected4">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="actual4">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="testercomments4">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="tester4">
    </textarea></td>
    <td>
    < select name="Y/N">
    < option value="Y">Y</option>
    < option value="N">N</option></td>
    </tr>
    <tr>
    <td><textarea rows="5" cols="20" id="task5">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="action5">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="expected5">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="actual5">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="testercomments5">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="tester5">
    </textarea></td>
    <td>
    < select name="Y/N">
    < option value="Y">Y</option>
    < option value="N">N</option></td>
    </tr>
    <tr>
    <td><textarea rows="5" cols="20" id="task6">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="action6">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="expected6">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="actual6">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="testercomments6">
    </textarea></td>
    <td><textarea rows="5" cols="20" id="tester6">
    </textarea></td>
    <td>
    < select name="Y/N">
    < option value="Y">Y</option>
    < option value="N">N</option></td>
    </tr>
    < /table>
    <input type="button" value="Submit" onclick="submitdetails()" />
    < /form>

    </body>
    </html>


Comments

  • Registered Users Posts: 83 ✭✭fatlog


    could you explain your problem a bit more.

    are you looking for suggestions for a scriptiong language to use or are you using ASP as is mentioned in your form signature.

    whats your background? what (if any) development environment do you have setup? Do you have a database, web server etc... in place?

    btw, you don't necessarily need to use a "scripting" language to process a form and save the details to a DB.


  • Closed Accounts Posts: 10 trax2011


    yes im looking for suggestions as to which way to go about taking the details from the form. im newish to this area and welcome any ideas. the page is for an intranet. as to the specifics for server type and so forth i dont got them details. sorry. Again any help given is much appreciated.


  • Registered Users Posts: 19,019 ✭✭✭✭murphaph


    You'll need to get those details fatlog mentioned to proceed. You need to know what the server will support (what server side languages and databases are on there etc.). I suggest you find out these details before doing anything else as you could be wasting time working on something which you can't implement on the live server.


  • Closed Accounts Posts: 10 trax2011


    rite well i have asked and asp, vbscript and jscript are the languages supported and for the database i will be using microsoft access. hope this is enough.


  • Registered Users Posts: 83 ✭✭fatlog


    what sort of experience do you have with any of those?
    are you relatively new to this aspect of programming?

    it sounds like you have a (type of) .NET setup.

    i know i'm being vague with my answers (sorry!) but it all really depends on where you are coming/starting from. Have you any knowledge of this area?

    For example, do you know the difference between GET and POST? if not then you need to get up to speed on a few things before jumping into the HTML you posted.

    I'll assume you are new to this. In that case you really need to look at a few tutorials on the area. I'll give a brief overview but if you already know this then sorry!

    GET and POST data is passed to the server from the browser with each request. So for example, in your sample HTML above, your form specifies the method as POST. When you Submit the form, the data is sent to "add_to_database.asp". All the form elements are also sent to that ASP script as POST data and are accessible through whatever method the language provides for accessing POST data. So all the TEXTAREA elements are posted to the server with their corresponding id/names.

    For connecting to the database you will probably be using ODBC. Most languages have built in capabilities for connecting to ODBC sources.

    Like i saidf I suggest you try a few tutorials. WHat you need to do first is get a simple form working without any database stuff. Put the aove code into a html file, create the "add_to_database.asp" script and work from there. Start by just printing what was entered into the form onto screen. Once you are comfortable with that then look at connecting to a database.

    Try this snippet of a tutorial...
    http://www.tizag.com/aspTutorial/aspFormsPost.php

    it has a simple form which posts to an ASP script which just prints out the form contents.
    That site also has various other tutorials on ASP as a whole which are worth looking at if you are just starting out.


  • Advertisement
  • Closed Accounts Posts: 10 trax2011


    cheers for the help...

    yep im just starting out and had a look at the tutorial and it is what i was looking for. done a few tutorials online and im fair enough with html and just getting started with the rest. asp seems to be the way im gonna go for the moment.


  • Registered Users Posts: 75 ✭✭1qTour


    if your just starting out i would say to get one text input and try to insert that into the database. after you get that working build onto it a little bit at a time.

    The more problems you run into the more you will end up knowing if you persist.

    Will post some code here for a basic example tomorrow.


  • Closed Accounts Posts: 10 trax2011


    rite got the first part sorted. using asp and vb script got my form done and all data goes where its supposed to which is perfect now im doing a simple html form where a specific record is pulled and displayed. any suggestions??


  • Closed Accounts Posts: 18,163 ✭✭✭✭Liam Byrne


    trax2011 wrote: »
    rite got the first part sorted. using asp and vb script got my form done and all data goes where its supposed to which is perfect now im doing a simple html form where a specific record is pulled and displayed. any suggestions??

    What do you need suggested ?


Advertisement