Home | Advertising Info23 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Thursday, January 16, 2025  

  Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
Classic ASP - General
 PowerASP Code Help Area : Classic ASP - General
Subject Info: Updating records with a <select> tag A d d  -  P o s tAdd P o s t
Author
Message << Prev Info | Next Info >>
shadowspell
Newbie
Newbie
Avatar

Joined: May/04/2004
Location: United States
Online Status: Offline
Info: 13
Added: December/13/2004 at 1:27pm | IP Logged Quote shadowspell

Hello all,
I'm dynamically constructing a <table> from records read from a database table. each record read will occupy one <tr> row with its data.

The last field of the record is populated by a <select> tag's dropdown list. The list is populated with data from a table of one field. This field contains potential 'statuses' of jobs, i.e. 'complete','pending','canceled', etc, etc. Here is the snippit of code below:
------------------------------------------------

If Not RS.EOF then
 Do While NOT RS.EOF
 %>
  <tr align="center" valign="top">
  <td><%=RS.Fields.Item("id").Value%>& lt;/td>
  <td><%=RS.Fields.Item("submit_date").Va lue%></td>
  <td><%=RS.Fields.Item("proj_req_due_dat e").Value%></td>
  <td width="55"><input name="proj_title" type="text" value="<%=RS("proj_title")%>" size="55" maxlength="255" readonly> 
  <input name="proj_url" type="text" id="proj_url" value="<%=RS("proj_url")%>" size="55" maxlength="255" readonly style="background-color:#FFFFCC;"></td>
  <td width="55"><textarea name="proj_det_desc" cols="50" rows="3" readonly="yes"><%=RS("proj_det_desc")%></textare a></td>
  <td><%=RS.Fields.Item("usr_fname").Valu e%>&nbsp;<%=RS.Fields.Item("usr_lname").Value%> </td>
  <td bgcolor="#FFEEDD">
  <select name="dev_proj_status">
  <%
  ' ///////////// Get the project 'status' data from the tbl_wr_dev_proj_status table ///////////
  statusSQLstmt = "SELECT status FROM tbl_wr_dev_proj_status ASC"
  Set statusRS = Conn.Execute(statusSQLstmt)
     Do While NOT statusRS.EOF
  %>
  <option <% if RS("dev_proj_status")=statusRS.fields("status").Value then response.write "selected" end if%>>
  <%=statusRS.fields("status").Value%></o ption>
 <%
  statusRS.movenext
  loop
 %>
</select>
</td></tr>
<%
RS.MoveNext
  Loop
Else
 Response.write "<tr valign='middle' height='35'><td align='left' colspan='7'><span class='mediumboldred'>You have no assigned jobs.</span></td></tr>"
End If

--------------------------------------------------------

So the only field that can be changed is the last 'status' field previously populated when the record was created. The purpose of this page is to allow the developer to change the status of one or more jobs.

Here's my question: If the developer changes the status of one or more jobs, how do I target those records to be updated? I know I must somehow use the record id but I'm not sure how to go about it.

Thanks for any help,
Chris~`^%



__________________
~`^%
In Vino Veritas
Back to Top View shadowspell's Profile Search for other info by shadowspell
 
elija
Newbie
Newbie
Avatar

Joined: September/04/2004
Location: United Kingdom
Online Status: Offline
Info: 8
Added: December/14/2004 at 4:37am | IP Logged Quote elija

Not entirely sure what your problem is...

Try putting the ID as a hidden field in the form (U'll have to give each one a name). It will then be passed through to the processing script on submit.

Elija


__________________
Programmer - a device for turning coffee into algorithms
Back to Top View elija's Profile Search for other info by elija Visit elija's Homepage
 
shadowspell
Newbie
Newbie
Avatar

Joined: May/04/2004
Location: United States
Online Status: Offline
Info: 13
Added: December/14/2004 at 8:57am | IP Logged Quote shadowspell

 

My problem is in my last question. How, in the processing page that follows upon submit, to find those arbitrary records the developer wants changed to the new 'status'. Say for example I have the following:

0001 - John Brown - Update Regulatory - 'Pending'
0003 - Mary Stein - Edit Plodicus Matrix - 'In Development'
0005 - M. Patient - Add Kingdom Drone to Nettlemesh - 'Pending'

Now, I want to update record 0001 and 0005 to status of 'In Development' by clicking the dropdown list (pretend you see the last fields contained within drop-down lists), then I click the submit button.

I want to be able to, with that one button click, update records 0001 and 0005 with their new statuses.

Thanks for your help and time,

Chris



__________________
~`^%
In Vino Veritas
Back to Top View shadowspell's Profile Search for other info by shadowspell
 

If you wish to make a comment to this info you must first login
If you are not already registered you must first register

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2025 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages ASP a directory of ASP tutorials applications scripts components and articles for the novice to professional developer. CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com