Jump to content

Error in getting value of two SELECT boxes


dearmoawiz

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.