Results 1 to 6 of 6
  1. #1
    Join Date
    May 2003
    Posts
    50

    Unanswered: request form Variable problem

    when i post form collection all variables are accesable by this method
    for example
    response.write(request.form("textFieldValue"))


    but i want to do this things
    request.form("textFieldValue")=""

    i want to aSSign value to the form value, but i get error
    Object doesn't support this property or method: 'form'



    what i'm doing wrong ?


    thanks for help

  2. #2
    Join Date
    Mar 2004
    Location
    India
    Posts
    56
    Your problem is not much clear .Can you provide the part of code which you are using.

    Using 'Request.form' you can not assign the values .This is using to retrieve the value assigned in varaiable.

    If you want assign a value to a text box in a form you can use HTML tag.

    best

    graceson

  3. #3
    Join Date
    May 2003
    Posts
    50
    <%
    if MY CONDITIONS then request.form("select1")=""


    here i simply want to check posted variable request.form("select1")
    if this var doesnt match to my conditions then i must to setup request.form("select1") variable to NULL

    because second select component works when request.form("select1") is not empty

    %>

    when i was used php, in php i can do this things, but how can i assign value to request.form collection variable using ASP ????




    <form method="post">


    <select name="select1" onchange="submit()">
    <option>...</option>
    <%
    set rs1 = create recordset ............
    while rs1.EOF=false
    %>
    <option value="<%=rs1.fields("field_id")%>"><%=rs1.fields( "field_name")%></option>
    <%
    wend
    %>
    </select>


    <select name="select2" onchange="submit()">
    <option>...</option>
    <%
    if request.form("select1")<>"" then

    set rs2 = create recordset ............
    while rs2.EOF=false
    %>
    <option value="<%=rs2.fields("field_id")%>"><%=rs2.fields( "field_name")%></option>
    <%
    wend
    %>

    end if
    </select>





    </form>




    thanks for help

  4. #4
    Join Date
    Mar 2004
    Location
    India
    Posts
    56
    difine a variable

    assign the request .form in avaraiable and check the variable for the condition.


    dim a

    a=Request.form("select1")

    if a (condition)

    end if

  5. #5
    Join Date
    May 2003
    Posts
    50

    thanks

    thanks for spending time, but this was simple.

    my question was about form collection,



    ok, it is not very big problem for me,

  6. #6
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    the values in the forms collects are read only. you can request what is submitted and but you can not change the value.

    the correct method of doing what you are trying to do is as suggested.

    request the value once and apply it to a variable, from then on whenever you want to reference that form value you use the variable which is read/write.

    this will also improve your performance as you don't need to go through the request object to find the values for things every time you want to perform a check or calculation.

Posting Permissions

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