Hi,

I want to make this field "Hidden" and want to select by default last option "Both". ho w i can do this?

           <input id="memberRoleIntlSeller" value="supplier" name="userrole" style="border: 0px none ;" onclick="document.getElementById('userrole-error').style.display='none';changesubmitbtnname('yes');"  type="radio" <? if($_REQUEST['userrole']=="supplier"){?>checked="checked"<? }else{echo "";} ?> />
                <font class="normal">
                <?=$suppliers_title?>
                </font></div>
              <div class="buyOrSellBox">
                <input id="memberRoleIntlBuyer" value="buyer" onclick="document.getElementById('userrole-error').style.display='none';changesubmitbtnname('yes');" name="userrole" style="border: 0px none ;"  type="radio" <? if($_REQUEST['userrole']=="buyer"){?>checked="checked"<? }else{echo "";} ?>/>
                <font class="normal">
                <?=$buyer_title?>
                </font></div>
              <div class="buyOrSellBox">
                <input id="memberRoleIntlBoth" value="both" onclick="document.getElementById('userrole-error').style.display='none';changesubmitbtnname('yes');" name="userrole" style="border: 0px none ;" type="radio" <? if($_REQUEST['userrole']=="both"){?>checked="checked"<? }else{echo "";} ?>/>

Best Regards,
Kashif

Recommended Answers

All 5 Replies

I dont think that your question is clear enough. Which field do you want to hide? Anyways, you can try this;

 <input type="hidden" id="memberRoleIntlSeller" ...

Hope that helps

Code for the last button:

<div class="buyOrSellBox">
<input id="memberRoleIntlBoth" value="both"
onclick="document.getElementById('userrole-error').style.display='none';changesubmitbtnname('yes');" 
name="userrole" style="border: 0px none ;" type="radio" 
<?
// the condition is:
// if $_REQUEST['userrole'] is not set (none of the radio buttons have been chosen)
// or the 'both' radio button has been chosen
// then make it checked
if(!isset($_REQUEST['userrole']) || (isset($_REQUEST['userrole']) && $_REQUEST['userrole']=="both")){
    echo 'checked="checked"';
}
?>
/>

I want to make this field "Hidden"

Which field do you want to make hidden - one button all the whole button group?

We want to hidden whole button group. With the default checked box "Both"

Wrap the button group in a div and make that div hidden:

<div id="button-group">

...

</div>

The CSS:

#button-group {
    visibility:hidden;
}

Hi,

I fixed it, now it is working. Thanks :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.