0

I'm sorry to ask a duplicate question again but i'm really got into this...

Down there is my code:

 <script type="text/javascript">
    function textHint()
    {
       Confirm("Do u want to proceed");
     }
  </script>
  <select name="duration" id="duration"  class="inp_bx" onChange="textHint();"> 
      <option value="1">-Select-</option>
        <?php
        $sql = "select distinct(package_type) from tbl_package";
        $retval = mysql_query($sql, $conn );
        if(! $retval )
         {
          die('Could not get data: ' . mysql_error());
          echo 'Could not get data: ' . mysql_error();
          }
         while($row = mysql_fetch_assoc($retval,MYSQL_ASSOC))
         {
            $package= $row['package_type'];?>   
            <option value="<?php echo $package?>"><?php echo $package;?>     
            </option>
        <?php } ?>
   </select>

I'm getting the value in select box from database but the onchange function is not triggering out...i dont know why?

This is similar to the one on the link:

call javascript function onchange event of dropdown list

Instead the value is fetched from the database...

Thanks in advance guys...

1 Answer 1

2

Javascript is case-sensitive. Your Confirm should be confirm.

function textHint()
{
   confirm("Do u want to proceed");
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.