Announcement

Collapse
No announcement yet.

checkboxes - only one ticked at once

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Stryker
    replied
    Thanks very much. I'll give it a go and see which I prefer. Beetle's comments make sense, but even so it's good to know there's a solution to this 'problem'.

    Leave a comment:


  • Marco
    replied
    You should just use radiobuttons, seeing as this is exactly what they were intended for.

    Leave a comment:


  • diades
    replied
    Hi Stryker

    I did this for a member of ours that had a situation that he had to do the same, check this out:
    http://webxpertz.net/forums/showthre...hlight=Discuss

    Leave a comment:


  • Merjawy
    replied
    yes theres a way but for the good of it I just can't think or remember how.. but there is a way to use it with checkbox, when you check one the other gets unchecked..

    sorry can't help you at this point

    Leave a comment:


  • Stryker
    replied
    Thanks for the replies. I was using radio buttons before, but wanted to switch to checkboxes purely for aesthetic reasons. If it's not possible to use them in this way I can change the form back to the way it was before.

    Leave a comment:


  • Merjawy
    replied
    I didn't try this but take a look

    HTML Code:
    <form name="txtlist" action="grapevine/index.php" method="get">
    		 <br>
     
    		 <table border="0" align="center" cellpadding="4" cellspacing="0" class="
    asb">
    			 <tr><td width="427">
    <input type="text" name="email" value="email address" size="20" maxlength
    ="100" onFocus="if (this.value=='email address') this.value=''" onBlur="if (this.
    value=='') this.value='email address'" class="forms">
    <input type="submit" name="sub" value="go" class="forms">
    						<input type="radio" name="type" id="type_sub" checked value="
    sub" >
    				<label for="type_sub"> Subscribe</label>
    				&nbsp;&nbsp;<input type="radio" name="type" value="unsub" id="
    type_unsub">
    				<label for="type_unsub"> Unsubscribe</label></td></tr>
    </table>
    </form> 

    I didn't see your reply Floris sorry

    Leave a comment:


  • Floris
    replied
    Checkboxes are so that you can make multiple selections, what you are looking for is a radiobutton, then you can select only one.

    Leave a comment:


  • Stryker
    started a topic checkboxes - only one ticked at once

    checkboxes - only one ticked at once

    Hi,

    Could someone help me out with the code for my mailing list form please? The form consists of an email input field and two checkboxes, one which allows you to subscribe to the list and another one which allows you to unsubscribe. At the moment both checkboxes can be ticked, which obviously doesn't make sense because you can't subscribe and unsubscribe at the same time. Here's my HTML code...

    PHP Code:
     <form name="txtlist" action="grapevine/index.php" method="get">
              <
    br>
                      
              <
    table border="0" align="center" cellpadding="4" cellspacing="0" class="asb">
                 <
    tr><td width="427">
    <
    input type="text" name="email" value="email address" size="20" maxlength="100" onFocus="if (this.value=='email address') this.value=''" onBlur="if (this.value=='') this.value='email address'" class="forms">
    <
    input type="submit" name="sub" value="go" class="forms">
                            <
    input type="checkbox" name="type" id="type_sub" value="sub" checked>
                    <
    label for="type_sub"Subscribe</label>
                    &
    nbsp;&nbsp;<input type="checkbox" name="type" value="unsub" id="type_unsub">
                    <
    label for="type_unsub"Unsubscribe</label>
    </
    td></tr>
     </
    table>
    </
    form
    Any help would be much appreciated, thanks.
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X