www.webdeveloper.com
Results 1 to 11 of 11

Thread: What should I do?

  1. #1
    Join Date
    Aug 2004
    Posts
    82

    What should I do?

    On my intranet I have a page that a user can submit a Q&A. I have a button to delete a Q&A item which is selected from a drop down. I also have an edit button which also works off the same drop down. The form action is set to indelete.asp which is used for deleting. How can I make the edit button work? Do I replace the form action with a javascript function to select which asp page to use?

  2. #2
    Join Date
    Jun 2004
    Posts
    390
    A simple solution would be to have 2 different form tags... each with an action pointing to a separate page.

  3. #3
    Join Date
    Aug 2004
    Posts
    82
    Ok, I'll try that.

  4. #4
    Join Date
    Aug 2004
    Posts
    82
    Any idea how I can populate text boxes from a database?

  5. #5
    Join Date
    Jun 2004
    Posts
    390
    Code:
    <%
        ...ASP code to get recordset...
    %>
    <input type="text" value="<%= recordsetName("columnName") %>" />
    I'm assuming you know how to select data out of a database.

  6. #6
    Join Date
    Aug 2004
    Posts
    82
    Here is what I used:

    PHP Code:
    <%
    strConnect "Provider=Microsoft.Jet.OLEDB.4.0; Data Source='c:\database\qa.mdb' ;Persist Security Info=False"
    set dbConn Server.CreateObject("ADODB.Connection")
    dbConn.Open strConnect 
    %> 
    PHP Code:
    <% 
    Dim qaTbInput
    strSQL 
    "SELECT * FROM qaTable WHERE qaQuestion= '" Request("qaSelect")&"'"
    Set qaTbInput Server.CreateObject("ADODB.Recordset")
    qaTbInput.Open strSQLdbConn
                
    %> 
    PHP Code:
    <input type="text" name="inQuestion" size="100" value="<%=qaTbInput("qaQuestion")%>">

    <
    textarea name="inAnswer" cols="100" rows="10" value="<%=qaTbInput("qaAnswer")%>"></textarea
    This returns error:

    ADODB.Field (0x80020009)
    Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
    /drintranet/qaedit.asp

    Do I need a Do While Not? There is data in the database...just checked. Any ideas?

  7. #7
    Join Date
    Jun 2004
    Posts
    390
    Is qaSelect being transfered to that page via a get method, post method, or something else?

    I'd really recommend using Request.QueryString() or Request.Form()

    Either way I'm guessing you don't have any information in your recordset at all. I'd recommend writing out qaSelect's value just to make sure that page is receiving it properly.

  8. #8
    Join Date
    Aug 2004
    Posts
    82
    qaSelect is set to Get

    Right now I have two items in my record set which I can select through qaSelect (listbox). I have an edit button which calls inedit.asp. The items in the listbox are valid, I just checked again. How to I used Request.QueryString() or Request.Form() in my code.

    THANKS!

  9. #9
    Join Date
    Jun 2004
    Posts
    390
    Instead of Request("qaSelect") use Request.QueryString("qaSelect") in your sql statement.

    Also do a Response.Write(Request.QueryString("qaSelect")) somewhere in your code to make sure it is retreiving the value correctly.

  10. #10
    Join Date
    Aug 2004
    Posts
    82
    Did those. It is not passing the value from qaSelect which is a listbox. Hmmmmmm......

  11. #11
    Join Date
    Aug 2004
    Posts
    82
    The problem is the edit button is not part of the same form as qaSelect. When I put qaSelect in the same form it passes the value but then my delete button does not work. How can I put both of them on the same form?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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



Recent Articles