dearmoawiz Posted April 16, 2008 Share Posted April 16, 2008 hi, I've two SELECT boxes.i want to get value if one of them. but its shows selected values of both.but i need either one of them. my slecet box code is <input type="radio" value="Choose Category :" name="rd" /> <select name="cboCategory1" class="box" id="cboCategory" > <option value="">All Category</option> <?php $sql2 = "SELECT * from tbl_engcategory WHERE Publish='Yes' ORDER BY cat_name"; dbQuery($sql2); $result2=dbQuery($sql2); while($row = dbFetchAssoc($result2)) { extract($row); ?> <option value="<?php echo $cat_id; ?>" <? if ($cat_id == @$fldcategory) { echo "selected"; } ?> ><?php echo $cat_name;} ?></option> </select><span class="error"><?php echo @$catrgoryerror; ?></span> <input type="radio" value="Choose Category :" name="rd" /> <select name="cboCategory2" class="box" id="cboCategory"> <option value="">All Category</option> <?php require_once '../library/config.php'; $sql2 = "SELECT * from tbl_textpages"; dbQuery($sql2); $result2=dbQuery($sql2); while($row = dbFetchAssoc($result2)){ extract($row); ?> <option value="<? echo "$tp_id"; ?>"<? if($tp_id == @$tpId) { echo "selected";}?>><? echo "$tp_CategoryName"; ?></option> <? } ?> </select> and my condition is : if(isset($_REQUEST['cboCategory1'])!= "") { /*$fldcategory=$_REQUEST['cboCategory1']; $sql ="INSERT INTO tbltextpageseng (cat_id, pagename, preamble, fldtext) VALUES ('$fldcategory', '$txtname', '$txtprembleeng', '$txttexteng')"; dbQuery($sql); $sql2 ="INSERT INTO tbltextpagesswedish (cat_id, pagename, preamble, fldtext) VALUES ('$fldcategory', '$txtname', '$txtprembleswedish', '$txttextswedish')"; dbQuery($sql2); */ echo "Pehla combo"; } if(isset($_REQUEST['cboCategory2'])!="") { echo "Dosra combo"; /* $fldcategory=$_REQUEST['cboCategory2']; $sql ="INSERT INTO tbltextpageseng (tp_id, pagename, preamble, fldtext) VALUES ('$fldcategory', '$txtname', '$txtprembleeng', '$txttexteng')"; dbQuery($sql); $sql2 ="INSERT INTO tbltextpagesswedish (tp_id, pagename, preamble, fldtext) VALUES ('$fldcategory', '$txtname', '$txtprembleswedish', '$txttextswedish')"; dbQuery($sql2);*/ } is there any one to guide me plz Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.