how to show/know the key name and value ?

Discussion in 'ASP General' started by Michael, Aug 19, 2004.

  1. Michael

    Michael Guest

    Hi,

    I am writting a ASP which will accept lots of data from user interface page.
    Is there a way that show me the each field or key name and value?

    For example;
    From the user interface page, the code is like this
    <Form name="my_form" action="my_action.asp" .....>
    ... ...
    <input type="Text" name="Text1" value="123">
    <input type="Text" name="Text2" value="aaa">
    <input type="Text" name="Text3" value="bbbb">
    ... ....

    </Form>

    There are maybe many many data fields to be shown on the page

    Then I want "my_action.asp" can show my the data like this way:

    Text1='123'
    Text2='aaa'
    Text3='bbbbb'

    I tried to use Response.Write request.forms() .., but it only shows me the
    value, how to show the key name?

    Kindly please tell me how to code it.

    Thanks

    Michael
    Michael, Aug 19, 2004
    #1
    1. Advertising

  2. Michael

    Ray at Guest

    Try this:

    <%
    For each q in Request.Form
    Response.Write q & "='" & Request.Form(q) & "'<br>"
    Next
    %>

    More info: http://www.aspfaq.com/show.asp?id=2036

    Ray at home


    "Michael" <> wrote in message
    news:...
    > Hi,
    >
    > I am writting a ASP which will accept lots of data from user interface

    page.
    > Is there a way that show me the each field or key name and value?
    >
    > For example;
    > From the user interface page, the code is like this
    > <Form name="my_form" action="my_action.asp" .....>
    > ... ...
    > <input type="Text" name="Text1" value="123">
    > <input type="Text" name="Text2" value="aaa">
    > <input type="Text" name="Text3" value="bbbb">
    > ... ....
    >
    > </Form>
    >
    > There are maybe many many data fields to be shown on the page
    >
    > Then I want "my_action.asp" can show my the data like this way:
    >
    > Text1='123'
    > Text2='aaa'
    > Text3='bbbbb'
    >
    > I tried to use Response.Write request.forms() .., but it only shows me the
    > value, how to show the key name?
    >
    > Kindly please tell me how to code it.
    >
    > Thanks
    >
    > Michael
    >
    >
    >
    >
    Ray at, Aug 19, 2004
    #2
    1. Advertising

  3. Michael

    Michael Guest

    hi,

    tried, not it is not working, error msg is "Invalid character ...
    Response.Write q ...."

    thx



    "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
    message news:...
    > Try this:
    >
    > <%
    > For each q in Request.Form
    > Response.Write q & "='" & Request.Form(q) & "'<br>"
    > Next
    > %>
    >
    > More info: http://www.aspfaq.com/show.asp?id=2036
    >
    > Ray at home
    >
    >
    > "Michael" <> wrote in message
    > news:...
    > > Hi,
    > >
    > > I am writting a ASP which will accept lots of data from user interface

    > page.
    > > Is there a way that show me the each field or key name and value?
    > >
    > > For example;
    > > From the user interface page, the code is like this
    > > <Form name="my_form" action="my_action.asp" .....>
    > > ... ...
    > > <input type="Text" name="Text1" value="123">
    > > <input type="Text" name="Text2" value="aaa">
    > > <input type="Text" name="Text3" value="bbbb">
    > > ... ....
    > >
    > > </Form>
    > >
    > > There are maybe many many data fields to be shown on the page
    > >
    > > Then I want "my_action.asp" can show my the data like this way:
    > >
    > > Text1='123'
    > > Text2='aaa'
    > > Text3='bbbbb'
    > >
    > > I tried to use Response.Write request.forms() .., but it only shows me

    the
    > > value, how to show the key name?
    > >
    > > Kindly please tell me how to code it.
    > >
    > > Thanks
    > >
    > > Michael
    > >
    > >
    > >
    > >

    >
    >
    Michael, Aug 19, 2004
    #3
  4. Michael

    Michael Guest

    hi,

    got it, it works now.

    the code is like this

    For i=1 to Request.Form.Count
    response.write i & ". " Response.Write Request.Form.Key(i) & " = " &
    Request.FORM.Item(i) & "<BR>"
    Next


    Thank you very much

    Michael




    "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
    message news:...
    > Try this:
    >
    > <%
    > For each q in Request.Form
    > Response.Write q & "='" & Request.Form(q) & "'<br>"
    > Next
    > %>
    >
    > More info: http://www.aspfaq.com/show.asp?id=2036
    >
    > Ray at home
    >
    >
    > "Michael" <> wrote in message
    > news:...
    > > Hi,
    > >
    > > I am writting a ASP which will accept lots of data from user interface

    > page.
    > > Is there a way that show me the each field or key name and value?
    > >
    > > For example;
    > > From the user interface page, the code is like this
    > > <Form name="my_form" action="my_action.asp" .....>
    > > ... ...
    > > <input type="Text" name="Text1" value="123">
    > > <input type="Text" name="Text2" value="aaa">
    > > <input type="Text" name="Text3" value="bbbb">
    > > ... ....
    > >
    > > </Form>
    > >
    > > There are maybe many many data fields to be shown on the page
    > >
    > > Then I want "my_action.asp" can show my the data like this way:
    > >
    > > Text1='123'
    > > Text2='aaa'
    > > Text3='bbbbb'
    > >
    > > I tried to use Response.Write request.forms() .., but it only shows me

    the
    > > value, how to show the key name?
    > >
    > > Kindly please tell me how to code it.
    > >
    > > Thanks
    > >
    > > Michael
    > >
    > >
    > >
    > >

    >
    >
    Michael, Aug 19, 2004
    #4
  5. Michael

    xFriday Guest

    Hello Michael,

    Iv tried making it smaller and less confusing.

    See if it works.

    For each item in Request.Form
    response.write item & " : " Response.Write Request.Form(item) & " <BR> "
    Next

    HTH,

    Naveen Bhalla
    http://www.xfriday.com/general/
    Get Software Development Project leads for free.
    xFriday, Aug 19, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SWu
    Replies:
    0
    Views:
    128
  2. M P
    Replies:
    1
    Views:
    466
  3. Une bévue
    Replies:
    5
    Views:
    149
    Une bévue
    Aug 10, 2006
  4. Antonio Quinonez
    Replies:
    2
    Views:
    167
    Antonio Quinonez
    Aug 14, 2003
  5. Andries

    I know, I know, I don't know

    Andries, Apr 23, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    228
    Gregory Toomey
    Apr 23, 2004
Loading...

Share This Page