Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Posts
    53

    Unanswered: cannot recognize....

    hi everybody...
    i really need help to solve my problem...i have a page(template_admin2.asp) where the the user will key in the information and all the information will be sent to another page(post.asp). in post.asp, update query will be process. the problem now is there is a list menu which i name it select.select will contain information that will be update to tb_aduan( field name- arahan).but, post.asp cannot recognize what information that contain in select.

    coding in template_admin2.asp

    <select name="select" size="1" title="<%=(Recordset2.Fields.Item("arahan").Value) %>">
    <%
    While (NOT Recordset2.EOF)%>
    <option value="<%=(Recordset2.Fields.Item("arahan").Value) %>"><%=(Recordset2.Fields.Item("arahan").Value)%> </option>
    <%
    Recordset2.MoveNext()
    Wend
    If (Recordset2.CursorType > 0) Then
    Recordset2.MoveFirst
    Else
    Recordset2.Requery
    End If
    %>
    '<%
    'arah=(Recordset2.Fields.Item("arahan").Value)%>
    </select>


    while the update command in post.asp is

    Dim keadaan
    Dim stat
    Dim aduan
    Dim arah
    Dim ked
    Dim lapo
    Dim ganti
    Dim uph
    Dim kos
    Dim perunding
    Dim jumlah
    Dim db
    Dim rs
    Dim UpdateQuery

    aduan=request.Form("idaduan")
    stat= request.Form("select2")
    arah= request.Form("select")
    ked= request.Form("keadaan")
    lapo= request.Form("textarea")
    ganti= request.Form("textarea2")
    uph= request.Form("textfield")
    kos= request.Form("textfield2")
    perunding= request.Form("textfield3")
    jumlah= request.Form("textfield4")

    set db=Server.CreateObject("ADODB.Connection")
    db.open "sambung"
    ked=session("idkeadaan")
    response.Write(ked)
    'response.write(arah)


    if (ked=1) then
    'response.write("1")
    response.write(arah)
    'UpdateQuery =" UPDATE tb_aduan SET status_id='"&stat&"',arahan='"&arah&"',keadaan='"& ked&"',laporan ='"&lapo&"',bhn_ganti ='"&ganti&"',upah='"&uph&"',kos_bhn='"&kos&"',peru ndingan='"&perunding&"',jumlah_kos='"&jumlah&"' WHERE id_aduan="&aduan&"'"
    UpdateQuery =" UPDATE tb_aduan SET arahan='"&arah&"' WHERE id_aduan="&aduan&""
    set rs=db.execute(UpdateQuery)

    else
    'response.write("2")
    response.write(arah)
    UpdateQuery =" UPDATE tb_aduan SET status_id='"&stat&"',keadaan='"&ked&"',laporan ='"&lapo&"',bhn_ganti ='"&ganti&"',upah='"&uph&"',kos_bhn='"&kos&"',peru ndingan='"&perunding&"',jumlah_kos='"&jumlah&"' WHERE id_aduan="&aduan&""
    set rs=db.execute(UpdateQuery)

    end if
    db.close


    please help meee

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    Firstly make sure your select box is inside you form tags.

    Try changing the name of the select box to something other then select (it shouldn't cause a problem but it might).

    When you response.write(arah) is anything written?

    Other then that, post the rest of the first file and I'll have a look (post.asp looks fine).

  3. #3
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Recordset2.Fields.Item("arahan").Value

    You use this value for both the name of the Select tag, the value of the select options, and the label for the select options. Therefore, it seems like the select box is not being passed with the name you are expecting.

    It may be helpful to post the compiled HTML so we can see what is actually being generated by your ASP.
    That which does not kill me postpones the inevitable.

  4. #4
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    It's the title of the select box not the name so in theoty it should be okie as the name is set to "select"

  5. #5
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Yeesh.. you're correct... sorry.. I just got back from the Presidential Library... I'm beat... I think you might be right about the location of the <form> tag...
    That which does not kill me postpones the inevitable.

Posting Permissions

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