checkbox and values

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pusulv@gmail.com

    checkbox and values

    Hi,
    I got a site whit some checkbox-es whit some value-es.

    I really want to extract the value of only checked checkboxes and put
    them ni my script bellow.

    Here are some of my checkboxes:
    [color=blue]
    > <input type="checkbox" value="a=sweb&" /> Web results
    > <input type="checkbox" value="a=simage &" /> Image results[/color]

    ....and from this I only want to get the value from the checked
    checkboxes (there are some more than showed abou) an put the valu in
    the script bellow:
    [color=blue]
    > function goTo() {
    > var searchInput = document.getEle mentById("searc hInput");
    > var url = 'http://a9.com/' +
    > encodeURI(searc hInput.value.re place(/[\s]/gi, '+')) + '?' + ALL-CHECKED-CHECKBOX-VALUES-HERE.value;
    >
    > }[/color]

    But how do I do this?

  • Jc

    #2
    Re: checkbox and values

    pusulv@gmail.co m wrote:[color=blue]
    > Hi,
    > I got a site whit some checkbox-es whit some value-es.
    >
    > I really want to extract the value of only checked checkboxes and put
    > them ni my script bellow.
    >
    > Here are some of my checkboxes:
    >[color=green]
    > > <input type="checkbox" value="a=sweb&" /> Web results
    > > <input type="checkbox" value="a=simage &" /> Image results[/color]
    >
    > ...and from this I only want to get the value from the checked
    > checkboxes (there are some more than showed abou) an put the valu in
    > the script bellow:
    >[color=green]
    > > function goTo() {
    > > var searchInput = document.getEle mentById("searc hInput");
    > > var url = 'http://a9.com/' +
    > > encodeURI(searc hInput.value.re place(/[\s]/gi, '+')) + '?' + ALL-CHECKED-CHECKBOX-VALUES-HERE.value;
    > >
    > > }[/color]
    >
    > But how do I do this?[/color]

    Refer to http://www.jibbering.com/faq/#FAQ4_13

    Comment

    Working...