0

Hi,
i need to know whether 2 or more jqueries can be used inside a module or a form but when i tried to do only one works the other is disabled pls help me to solve this solution

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by ravi52542
0

yeah sure! i used colorbox and datepicker in a module i can able to use only one jquery either colorbox or datepicker if i disable all the jquery scripts for colorbox datepicker works and vice-versa

<?PHP
    session_start();
    require_once('./includes/common.inc.php');
    checkIsUser();
    mysql_query(CHANGE_TO_IDENTIVE_ADDRESS_BOOK);
    $sql='select * from '.PERSON;
    $result=mysql_query($sql,$address) or die('Error' . mysql_error());
    $loc = array();
    while ($row = mysql_fetch_assoc($result)) {
        $loc[] = array('userid' => $row['userid'],'name' =>$row['username']);
    } 
    mysql_query(CHANGE_TO_HRMS);
    $query='select * from '.DEPARTMENT;
    $result1=mysql_query($query,$address) or die('Error' . mysql_error());
    $loc1 = array();
    while ($row1 = mysql_fetch_assoc($result1)) {
        $loc1[] = array('id' => $row1['id'],'name' =>$row1['name']);
    }
    $query1='select * from '.DESIGNATION;
    $result2=mysql_query($query1,$address) or die('Error' . mysql_error());
    $loc2 = array();
    while ($row2 = mysql_fetch_assoc($result2)) {
        $loc2[] = array('id' => $row2['id'],'name' =>$row2['name']);
    } 
    
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Identive Groups</title>
    <link href="./res/css/style1.css" rel="stylesheet" type="text/css"/> 
    <link href="./tools/jquery/accordion/css/style1.css" rel="stylesheet" type="text/css"/>
    <link href="./res/css/pagelay.css" rel="stylesheet" type="text/css"/>
    <link href="./res/css/menustyle.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="./tools/jquery/colorbox/css/colorbox.css" />
    <script src="./tools/jquery/colorbox/js/jquery.min.js"></script>
    <script src="./tools/jquery/colorbox/js/jquery.colorbox.js"></script>
    <script src="./tools/jquery/colorbox/js/jquery.colorbox-min.js"></script>
    <script src="./tools/jquery/colorbox/js/color.js"></script> 
    <link rel="stylesheet" href="./tools/jquery/datepicker/css/jquery.ui.all.css" />
    <script type="text/javascript" src="./tools/jquery/datepicker/scripts/jquery-1.4.2.js"></script>
    <script type="text/javascript" src="./tools/jquery/datepicker/scripts/jquery.ui.core.js"></script>
    <script type="text/javascript" src="./tools/jquery/datepicker/scripts/jquery.ui.widget.js"></script>
    <script type="text/javascript" src="./tools/jquery/datepicker/scripts/jquery.ui.datepicker.js"></script>
    <script>
	$(function() {
		$( "#datepicker" ).datepicker({
			changeMonth: true,
			changeYear: true
		});
                $( "#datepicker1" ).datepicker({
			changeMonth: true,
			changeYear: true
		});
	});
	</script>
    <script>
        $(document).ready(function() {
            
         $("#status").change(function(){
             if( $("#status").val()== "Probation"){
                 $("#confirmedDate").show('drop');
             }else{
                  $("#confirmedDate").hide('drop');
             }
             
         });
       $("#deptselect").change(function(){
              $.ajax({
                    type: "POST",
                    data: {'depselect':$("#deptselect").val()},
                    url: "gethod.php",
                    dataType: "json",
                    success: function (data){
                     $('#depHOD').empty(); 
                      //alert(data.depHOD.username);
                     // for (var i = 0; i <= data.length - 1; i++) {
                            
                        //  alert(depHOD[i].username);
                        $("#depHOD").get(0).options[$("#depHOD").get(0).options.length] = new Option(data.depHOD.username, data.depHOD.hod);
                        //}
                    }
                    });
            });
             });
         </script>
         <script type="text/javascript">
$(function() {
	$('#popupDatepicker').datepick();
        $('#popupDatepicker1').datepick();
	$('#inlineDatepicker').datepick({onSelect: showDate});
        change: function(e, date)  {
		$("#theday").html(this.getValue("dd<span>mmmm yyyy</span>")); 
	}
});
        </script>
        <script type="text/javascript">
       function setOptions(chosen) {
            var selbox = document.register.opttwo;
            selbox.options.length = 0;
            if (chosen == " ") {
                selbox.options[selbox.options.length] = 
                new Option('Please select one of the options above first','null'); 
            }
            if (chosen == "Contract") {
                selbox.options[selbox.options.length] = 
                new Option('>>Please select any Value<<','');
                selbox.options[selbox.options.length] = 
                new Option('On-Contract','On-Contract');
                           //option name,option value
            }
            if (chosen == "Permanent") {
                selbox.options[selbox.options.length] = 
                new Option('>>Please select any Value<<','');
                selbox.options[selbox.options.length] = 
                new Option('Probation','Probation');
                          //option name,option value
                selbox.options[selbox.options.length] = 
                new Option('Confirmed','Confirmed');
                          //option name,option value
            }
       }
        </script>
        <script type="text/javascript" href="./res/scripts/script.js" rel="" type="text/js"></script></head>
    <body onload="document.register.regselect.focus(); ">
        <div id="cdnavcontbck">
        <div id="cdnavcontainer">
	<div id="cdtopnavlinks">
            <a class="cdchrm" rel="nofollow" href="logout.php">Log Out</a>
            <span> | </span>
            <a class="cdglobe cdchrm" href="#" tabindex="-1"><img src="./res/images/bg/globe.png"/></a>
            <a class="cdchrm" href="#"><?php echo $_SESSION['loginname'];?></a>
	</div><div class="cdclr">
		&nbsp;
	</div><div id="cdlogo">
		<img src="res/images/bg/logo.png"  width=250px height=40px alt="Identive Technologies, Chennai"/></a>
	</div><div class="cdclr">
		&nbsp;
	</div>
</div>
            <div id="cdtabarea">
	<ul id="cdtoptabs">
		<li class="cdtopn "><a href="hr.php">Home</a></li>
                <li class="cdtopn "><a href="group.php">Groups</a></li>
                <li class="cdtopn"><a href="depart.php">Departments</a></li>
                <li class="cdtopn cdselected"><a href="#">Employees</a></li>
                </ul>
               
</div>	
	</div>
    
        <ul class="vert-one">
                             <li><a class="current" href="./addemployee.php">Add Employee</a></li>
                            <li><a class="group1" href="./selectemp.php">Edit Employee</a></li>
                            <li><a href="./empdetails.php">View Colleagues</a></li>
                     </ul>
        <div id="cdCntPane">
		<div id="cdCnt">
			<div id="cdCntTop">
				
			</div>
			<div id="cdCntMid">
                            
                            <form action="addemp.php" method="post" name="register" id="userForm">
                                <table>
                                    <tr><td><h2 style="text-decoration:underline; float:left;">New Employee Registration</h2></td></tr>
                             <tr><td>
                                    &nbsp;
                                </td></tr>
                            <tr>
                                <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Select Name :</td>
                                <td><select name="regselect">
                                  <option value="null">>>Please select any value<<</option>
                                    <?PHP foreach ($loc as $local){ ?>
                                    <option value="<?PHP echo $local['userid'];?>"><?PHP echo $local['name'];?></option>
                                    <?PHP } ?>
                                    </select>
                                </td>
                            </tr>
                            <tr><td>
                                    &nbsp;
                                </td></tr>
                            <tr>
                                 <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Full Name of the Employee :</td>
                                 <td>
                                     <input type="text" name="fullname" size="30"/>
                                 </td>
                            </tr>
                            <tr><td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                               <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Department</td>
                               <td><select name="depselect" id="deptselect">
                                     <option value="null">>>Please select any value<<</option>
                                     <?PHP foreach ($loc1 as $local1){ ?>
                                    <option value="<?PHP echo $local1['id'];?>"><?PHP echo $local1['name'];?></option>
                                    <?PHP } ?>
                                    </select>
                              </td>
                              <td>Head Of the Department:</td>
                              <td> <select name="depHOD" id="depHOD" disabled="disabled">                                
				
			</select></td>
                            </tr>
                            <tr><td>
                                    &nbsp;
                                </td></tr>
                                <tr>
                                    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Designation :</td>
                                    <td><select name="desselect">
                                            <option value="null">>>Please select any value<<</option>
                                            <?PHP foreach ($loc2 as $local2){ ?>
                                            <option value="<?PHP echo $local2['id'];?>"><?PHP echo $local2['name'];?></option>
                                             <?PHP } ?>
                                        </select>
                                        
                                    </td>
                                </tr>
                            <tr><td>
                                    &nbsp;
                                </td></tr>
                            <tr>
                                <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Manager :</td>
                                <td>
                                    <select name="manager">
                                        <option value="null">>>Please select any value<<</option>
                                        <?PHP foreach ($loc as $local){ ?>
                                             <option value="<?PHP echo $local['userid'];?>"><?PHP echo $local['name'];?></option>
                                        <?PHP } ?>
                                    </select>
                                </td>
                            </tr>
                            <tr><td>
                                    &nbsp;
                                </td></tr>
                            <tr>
                                <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hire Type :</td>
                                <td><select name="optone" id="hire" onChange="setOptions(document.register.optone.options[document.register.optone.selectedIndex].value)">
                                        <option value=" ">>>Please Select any value<<</option>
                                        <option value="Contract">Contract</option>
                                        <option value="Permanent">Permanent</option>                             
                                    </select>
                                </td>
                            </tr>
                             <tr><td>
                                    &nbsp;
                                </td></tr>
                            <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Current Status :</td>
                                <td><select name="opttwo" id="status">
                                        <option value=" ">>>Please select Hire Type<<</option>
                                    </select>
                                </td>
                                <div class="demo">
                                <p><td>Joining Date :</td></p>
                                <p><td><input type="text" name="date1" id="datepicker" size="30"/></td></p>
                                <td><label style="color:darkblue">dd/mm/yyyy</label></td>
                                  </div>
                               </tr>
                        <tr><td>
                                    &nbsp;
                                </td></tr>
                            <div id="confirmedDate" style="display:none;">
                                Will be Confirmed On :
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <input type="text" name="confirmDate" id="datepicker1"  size="30"/>
                                <label style="color:darkblue">dd/mm/yyyy</label>
                            </div>
                        <tr><td>
                                    &nbsp;
                                </td></tr>
                        <tr><td>&nbsp;</td>
                            <td align="center"><input type="submit" value="Register Employee"/>
                            <input type="reset" value="Revert Changes"/></td>
                             </table>
                            </form>
                              </div>
		<div id="cdCntBot">
        		&nbsp;
		</div>
	</div>
    </div>
    <div id="footer"><span>Identive Technologies. All rights reserved.</span></div>
    <div id="cdBotBod">
        &nbsp;
    </div>       
    </body>
</html>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.