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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.