Initial values in a form

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Initial values in a form

    Is it possible to create a form on a page for updating a record in a
    database where the initial values in the form are taken from the database?
    If so how is it best done?

    Geoff Wickens


    Geoff Wickens Guest

  2. Similar Questions and Discussions

    1. Can't display initial XML values
      I've created a SWF that pulls information from an XML file. When one of several hundred buttons is clicked, it searches the XML file for that...
    2. composite control: how to assign initial values to child controls?
      Hi all, I've got a question concerning composite controls: As you can see, in my CreateChildControls method I have two custom child controls,...
    3. Populate form values based on previous same form fields
      This message is cross posted in alt.comp.lang.php & comp.lang.javascript I have a form for a user to input an establishment's hours and what time...
    4. Form submission fills form values with garbage
      Hey all, I'm attempting to do some form processing on a server that has register_globals off, however, I've run into a confusing situation and...
    5. $: - where does it get its initial values?
      Howdy, Where does $: get its values from? The book says that it contains an array of places to search for loaded files and that it is...
  3. #2

    Default Re: Initial values in a form

    Geoff Wickens wrote:
    > Is it possible to create a form on a page for updating a record in a
    > database where the initial values in the form are taken from the
    > database?
    yes
    > If so how is it best done?
    <input type="text" value="<%=rs.field(n).value%>"...>

    for example

    --
    William Tasso - [url]http://WilliamTasso.com[/url]


    William Tasso Guest

  4. #3

    Default Re: Initial values in a form

    You will probably think I am incredibly stupid, but I don't really
    understand what you mean by rs.field(n).value%>

    I have posted my whole code to see if it makes sense to you:

    <h2 align="center">Amending a booking</h2>
    <table width="100%" border="1" cellpadding="5">
    <tr>
    <td width="10%" height="25"><font
    size="1"><b>BookingID</b></font></td>
    <td width="21%" height="25"><font size="1"><b>Date</b></font></td>
    <td width="20%" height="25"><font size="1"><b>Band</b></font></td>
    <td width="22%" height="25"><font
    size="1"><b>Venue</b></font></td>
    <td width="27%" height="25"><font size="1"><b>Time</b></font></td>
    </tr>
    <%
    d = Request.Form("eventid")
    Set Catalog=Server.CreateObject("ADODB.Recordset")
    Catalog.open "SELECT * FROM qrybookingsall WHERE eventID =" & d,
    "DSN=calendar"
    DayCalc = Catalog("ddate")
    DayNo = Day(DayCalc)
    strWeekDayName = WeekDayName(WeekDay(DayCalc), True, vbSunday)
    intMonth = Month(daycalc)
    strMonthName = MonthName(intMonth, True)
    YearNo = Year(DayCalc)
    Response.Write "<tr valign='top'><td><font size='1'>" & Catalog("eventID") &
    "</font></td><td><font size='1'>" & strWeekDayName & " " & DayNo & " " &
    strMonthName & " " & YearNo & "</font></td><td><font size='1'>" &
    Catalog("band") & "</font></td><td><font size='1'>" & Catalog("venue") &
    "</font></td><td><font size='1'>" & Catalog("ttime")& "</font></td></tr>"


    Catalog.Close
    Set Catalog=Nothing
    %>
    </table>
    <form name="form1" method="post" action="bookingamend3.asp">
    <table width="80%" border="0" cellpadding="5">
    <tr>
    <td width="24%">BookingID:</td>
    <td width="76%">
    <input type="text" name="eventiid">
    </td>
    </tr>
    <tr>
    <td width="24%">Date:</td>
    <td width="76%">
    <input type="text" name="ddate">
    <i><font size="1">(Enter in the format 29/2/04)</font></i>
    </td>
    </tr>
    <tr>
    <td width="24%">Band:</td>
    <td width="76%">
    <select name="band" size="1">
    <option selected>Town Band</option>
    <option>Concert Brass</option>
    <option>Training Band</option>
    <option>!0 Piece</option>
    </select>
    </td>
    </tr>
    <tr>
    <td width="24%">Time:</td>
    <td width="76%">
    <input type="text" name="ttime">
    </td>
    </tr>
    <tr>
    <td width="24%">Venue:</td>
    <td width="76%">
    <input type="text" name="venue">
    </td>
    </tr>
    <tr>
    <td width="24%" valign="top">Notes:</td>
    <td width="76%">
    <textarea name="notes" cols="60" rows="5"></textarea>
    </td>
    </tr>
    <tr>
    <td width="24%">Confirm:</td>
    <td width="76%">
    <select name="confirm" size="1">
    <option selected>Yes</option>
    <option>No</option>
    </select>
    </td>
    </tr>
    </table>
    <p>
    <input type="submit" name="Submit" value="Submit">
    <input type="reset" name="Reset" value="Reset">
    </p>
    </form>
    <p>&nbsp;</p>

    "William Tasso" <ngx@tbdata.com> wrote in message
    news:%23WfTrPUbDHA.2344@TK2MSFTNGP09.phx.gbl...
    > Geoff Wickens wrote:
    > > Is it possible to create a form on a page for updating a record in a
    > > database where the initial values in the form are taken from the
    > > database?
    >
    > yes
    >
    > > If so how is it best done?
    >
    > <input type="text" value="<%=rs.field(n).value%>"...>
    >
    > for example
    >
    > --
    > William Tasso - [url]http://WilliamTasso.com[/url]
    >
    >

    Geoff Wickens Guest

  5. #4

    Default Re: Initial values in a form

    Geoff Wickens wrote:
    > "William Tasso" <ngx@tbdata.com> wrote in message
    > news:%23WfTrPUbDHA.2344@TK2MSFTNGP09.phx.gbl...
    >> Geoff Wickens wrote:
    >>> Is it possible to create a form on a page for updating a record in a
    >>> database where the initial values in the form are taken from the
    >>> database?
    >>
    >> yes
    >>
    >>> If so how is it best done?
    >>
    >> <input type="text" value="<%=rs.field(n).value%>"...>
    >>
    >> for example
    >>
    > You will probably think I am incredibly stupid, but I don't really
    > understand what you mean by rs.field(n).value%>
    > I have posted my whole code to see if it makes sense to you:
    > ...
    ok, more specifically using examples from your asp
    <input type="text" name="venue" value="<%=Catalog("venue") %>">

    does that make more sense?
    --
    William Tasso - [url]http://WilliamTasso.com[/url]


    William Tasso Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139