SelectBox and PHP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • point

    SelectBox and PHP

    Hy there...

    I have the following:

    <select name="options">
    <option value="10">numb er10</options>
    <option value="20">numb er20</options>
    </select>

    If I want to print the choice I would use $_POST{'options '} and the
    $_POST{'options '} would have values of selected choice(10,20)

    But how can I print the selected text,not value(number10, number20) or do I
    have to use JS for that?

    Thanx....

    point


  • Geoff Berrow

    #2
    Re: SelectBox and PHP

    Message-ID: <bj1nqr01is9@en ews3.newsguy.co m> from point contained the
    following:
    [color=blue]
    >If I want to print the choice I would use $_POST{'options '} and the
    >$_POST{'option s'} would have values of selected choice(10,20)[/color]

    Square braces I think.[color=blue]
    >
    >But how can I print the selected text,not value(number10, number20) or do I
    >have to use JS for that?[/color]



    --
    Geoff Berrow
    It's only Usenet, no one dies.
    My opinions, not the committee's, mine.
    Simple RFDs http://www.ckdog.co.uk/rfdmaker/

    Comment

    • point

      #3
      Re: SelectBox and PHP

      ????

      I don't get it.....

      I know what is switch used for but I need text from select box not switching
      values....

      Could you be more specific what did you ment...

      Respect...


      "Geoff Berrow" <$bl$@ckdog.co. uk> wrote in message
      news:k5r8lvs9lf ohnq5ot5neobl6t vldqseb24@4ax.c om...[color=blue]
      > Message-ID: <bj1nqr01is9@en ews3.newsguy.co m> from point contained the
      > following:
      >[color=green]
      > >If I want to print the choice I would use $_POST{'options '} and the
      > >$_POST{'option s'} would have values of selected choice(10,20)[/color]
      >
      > Square braces I think.[color=green]
      > >
      > >But how can I print the selected text,not value(number10, number20) or do[/color][/color]
      I[color=blue][color=green]
      > >have to use JS for that?[/color]
      >
      > http://uk.php.net/switch
      >
      > --
      > Geoff Berrow
      > It's only Usenet, no one dies.
      > My opinions, not the committee's, mine.
      > Simple RFDs http://www.ckdog.co.uk/rfdmaker/[/color]


      Comment

      • point

        #4
        Re: SelectBox and PHP

        > > >$_POST{'option s'} would have values of selected choice(10,20)[color=blue][color=green]
        > >
        > > Square braces I think.[/color][/color]

        That's my standard coding practice....wor ks like this too....

        respect....


        Comment

        • Janwillem Borleffs

          #5
          Re: SelectBox and PHP


          "point" <point@caanNOSP AMproduction.co m> schreef in bericht
          news:bj1nqr01is 9@enews3.newsgu y.com...[color=blue]
          >
          > But how can I print the selected text,not value(number10, number20) or do I
          > have to use JS for that?
          >[/color]

          Yes, as only the option's value will be submitted...

          JW




          Comment

          • Geoff Berrow

            #6
            Re: SelectBox and PHP

            Message-ID: <bj21lh01t1k@en ews3.newsguy.co m> from point contained the
            following:
            [color=blue]
            >I don't get it.....
            >
            >I know what is switch used for but I need text from select box not switching
            >values....[/color]


            But the script is not returning that text, only the values. However if you
            code the options text in the switch statement ( or better yet assign the
            text to separate variables and include those both in the switch statement
            and the options box) then you can print the text depending on which value
            is selected.

            Hope that's clear.
            --
            Geoff Berrow
            It's only Usenet, no one dies.
            My opinions, not the committee's, mine.
            Simple RFDs http://www.ckdog.co.uk/rfdmaker/

            Comment

            • point

              #7
              Re: SelectBox and PHP

              Thanks...

              That's what I wanted to hear...

              respect...

              "Janwillem Borleffs" <jwb@jwbfoto.de mon.nl> wrote in message
              news:3f549127$1 $28907$1b62eedf @news.euronet.n l...[color=blue]
              >
              > "point" <point@caanNOSP AMproduction.co m> schreef in bericht
              > news:bj1nqr01is 9@enews3.newsgu y.com...[color=green]
              > >
              > > But how can I print the selected text,not value(number10, number20) or do[/color][/color]
              I[color=blue][color=green]
              > > have to use JS for that?
              > >[/color]
              >
              > Yes, as only the option's value will be submitted...
              >
              > JW
              >
              >
              >
              >[/color]


              Comment

              Working...