Multiple values for radio buttons

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

    Multiple values for radio buttons

    Hi,

    I have a form on a web page with a number of radio buttons bound to
    the same field. Is it possible to set up the form so that users can
    select more than one radio button to submit multiple values to a field
    in the way that you can, for example, in a drop down field?

    Thanks in advance for any suggestions.

    With regards


    Emmett Power
  • Tim Slattery

    #2
    Re: Multiple values for radio buttons

    Emmett@Silico-Research.com (Emmett Power) wrote:
    [color=blue]
    >Hi,
    >
    >I have a form on a web page with a number of radio buttons bound to
    >the same field. Is it possible to set up the form so that users can
    >select more than one radio button to submit multiple values to a field
    >in the way that you can, for example, in a drop down field?[/color]

    Nope, that's not the way radio buttons work. It sounds like you're
    looking for checkboxes, they would behave the closer to the way you
    want. The user could select any combination of the checkboxes, the web
    app would receive an "x=y" for each box selected.

    --
    Tim Slattery
    MS MVP(DTS)
    Slattery_T@bls. gov

    Comment

    • Emmett Power

      #3
      Re: Multiple values for radio buttons

      Thanks Tim,

      I guess if I give the checkboxes the same name but different values I'll
      achieve what I'm looking for.

      Regards

      Emmett Power



      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • Roland Hall

        #4
        Re: Multiple values for radio buttons

        "Emmett Power" wrote in message news:u23SzppNEH A.620@TK2MSFTNG P10.phx.gbl...
        : I guess if I give the checkboxes the same name but different values I'll
        : achieve what I'm looking for.

        There is no ASP script in these but this examples show how to use checkboxes
        and multiple selects. Other than scripting language and related, they are
        exactly the same:

        VBScript version:


        J(ava)Script version:


        HTH...

        --
        Roland Hall
        /* This information is distributed in the hope that it will be useful, but
        without any warranty; without even the implied warranty of merchantability
        or fitness for a particular purpose. */
        Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
        WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
        MSDN Library - http://msdn.microsoft.com/library/default.asp


        Comment

        • Emmett Power

          #5
          Re: Multiple values for radio buttons

          "Roland Hall" <nobody@nowhere > wrote in message news:<OrUWLDrNE HA.1616@TK2MSFT NGP12.phx.gbl>. ..[color=blue]
          > "Emmett Power" wrote in message news:u23SzppNEH A.620@TK2MSFTNG P10.phx.gbl...
          > : I guess if I give the checkboxes the same name but different values I'll
          > : achieve what I'm looking for.
          >
          > There is no ASP script in these but this examples show how to use checkboxes
          > and multiple selects. Other than scripting language and related, they are
          > exactly the same:
          >
          > VBScript version:
          > http://kiddanger.com/lab/exp.asp
          >
          > J(ava)Script version:
          > http://kiddanger.com/lab/expjs.asp
          >
          > HTH...[/color]

          Roland,

          Thanks for the code. It is very helpful.

          Regards

          Emmett

          Comment

          • Roland Hall

            #6
            Re: Multiple values for radio buttons

            "Emmett Power" wrote in message
            news:6e11de5c.0 405120209.19178 012@posting.goo gle.com...
            : "Roland Hall" <nobody@nowhere > wrote in message
            news:<OrUWLDrNE HA.1616@TK2MSFT NGP12.phx.gbl>. ..
            : > "Emmett Power" wrote in message
            news:u23SzppNEH A.620@TK2MSFTNG P10.phx.gbl...
            : > : I guess if I give the checkboxes the same name but different values
            I'll
            : > : achieve what I'm looking for.
            : >
            : > There is no ASP script in these but this examples show how to use
            checkboxes
            : > and multiple selects. Other than scripting language and related, they
            are
            : > exactly the same:
            : >
            : > VBScript version:
            : > http://kiddanger.com/lab/exp.asp
            : >
            : > J(ava)Script version:
            : > http://kiddanger.com/lab/expjs.asp
            : >
            : > HTH...
            :
            : Roland,
            :
            : Thanks for the code. It is very helpful.

            Hi Emmett...

            You're welcome. BTW... Here is the code for exp2.asp that both of the files
            call.

            <%@ Language=VBScri pt %>
            <% Option Explicit
            ' called from c:\exp.vbs
            dim oArgs, i
            oArgs = split(Request.Q ueryString("tas ks"),", ")
            for i = 0 to ubound(oArgs)
            Response.Write( oArgs(i) & "<br />" & vbCrLf)
            next
            %>

            This, if you're not familiar, shows you how to pass and parse a multi-value
            variable rather than with a form that passes one value per variable. Ignore
            the comment for called from c:\exp.vbs. This file was first used as a post
            target from a local WSH file.

            It started here:


            This started with code from someone else.

            Converted from WSH to VBScript/J(ava)Script for the web here:


            ....which has some other interesting examples of using checkboxes although
            granted checkboxes are not the best solution in these examples. It was more
            due to the topic of discussion.

            --
            Roland Hall
            /* This information is distributed in the hope that it will be useful, but w
            ithout any warranty; without even the implied warranty of merchantability or
            fitness for a particular purpose. */
            Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
            WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
            MSDN Library - http://msdn.microsoft.com/library/default.asp


            Comment

            • Emmett Power

              #7
              Re: Multiple values for radio buttons

              "Roland Hall" <nobody@nowhere > wrote in message news:<ehmioQBOE HA.1392@TK2MSFT NGP09.phx.gbl>. ..[color=blue]
              > "Emmett Power" wrote in message
              > news:6e11de5c.0 405120209.19178 012@posting.goo gle.com...
              > : "Roland Hall" <nobody@nowhere > wrote in message
              > news:<OrUWLDrNE HA.1616@TK2MSFT NGP12.phx.gbl>. ..
              > : > "Emmett Power" wrote in message
              > news:u23SzppNEH A.620@TK2MSFTNG P10.phx.gbl...
              > : > : I guess if I give the checkboxes the same name but different values
              > I'll
              > : > : achieve what I'm looking for.
              > : >
              > : > There is no ASP script in these but this examples show how to use
              > checkboxes
              > : > and multiple selects. Other than scripting language and related, they
              > are
              > : > exactly the same:
              > : >
              > : > VBScript version:
              > : > http://kiddanger.com/lab/exp.asp
              > : >
              > : > J(ava)Script version:
              > : > http://kiddanger.com/lab/expjs.asp
              > : >
              > : > HTH...
              > :
              > : Roland,
              > :
              > : Thanks for the code. It is very helpful.
              >
              > Hi Emmett...
              >
              > You're welcome. BTW... Here is the code for exp2.asp that both of the files
              > call.
              >
              > <%@ Language=VBScri pt %>
              > <% Option Explicit
              > ' called from c:\exp.vbs
              > dim oArgs, i
              > oArgs = split(Request.Q ueryString("tas ks"),", ")
              > for i = 0 to ubound(oArgs)
              > Response.Write( oArgs(i) & "<br />" & vbCrLf)
              > next
              > %>
              >
              > This, if you're not familiar, shows you how to pass and parse a multi-value
              > variable rather than with a form that passes one value per variable. Ignore
              > the comment for called from c:\exp.vbs. This file was first used as a post
              > target from a local WSH file.
              >
              > It started here:
              > http://groups.google.com/groups?q=ro...phx.gbl&rnum=2
              >
              > This started with code from someone else.
              >
              > Converted from WSH to VBScript/J(ava)Script for the web here:
              > http://groups.google.com/groups?q=ro...phx.gbl&rnum=1
              >
              > ...which has some other interesting examples of using checkboxes although
              > granted checkboxes are not the best solution in these examples. It was more
              > due to the topic of discussion.[/color]


              Thanks for the help Roland.

              Regards

              Emmett

              Comment

              Working...