我正在使用jquery Datepicker
事情是,当我第一次打开我的网站并且没有设置会话时,datepicker按预期工作..
在我之后,让我们说,登录并为该用户设置一个会话,datepicker只是停止工作,但我的其他js剧照像往常一样运行..
有什么想法吗?
问候
代码在这里:
包含文件; (header.php文件) (仅显示包含Datepicker的内容)
<script src="http://localhost/Azores4YouV2/public/js/jquery.pickmeup.min.js"></script>
<script src="http://localhost/Azores4YouV2/public/js/jquery.pickmeup.js"></script>
<link rel="stylesheet" type="text/css" href="http://localhost/Azores4YouV2/public/css/pickmeup.min.css"/>
<link rel="stylesheet" type="text/css" href="http://localhost/Azores4YouV2/public/css/pickmeup.css"/>
Controller发送要呈现的视图
查看:
public function render($name, $noInclude = false)
{
include 'views/header.php';
include 'views/' . $name . '.php';
include 'views/footer.php';
}
登录(设置会话的函数示例,设置会话的任何其他函数,都会导致同样的问题)
//queries to get the values
$_SESSION['user_data']=array('idcliente' => $id, 'nome' => $nome, 'email' => $email, 'password' => $password, 'morada' => $address, 'telefone' => $telefone, 'ncontribuinte' => $n_contribuinte );
登录并设置会话后,控制器再次呈现视图
而且datepicker停止工作
以下是使用datepicker
的表单 <form name="travel" method="post" action="<?php echo URL?>booking/booking">
<input style="background: url(http://localhost/Azores4YouV2/public/images/calendar.png) no-repeat right center; background-size: 15px 15px; width: 45%; margin-top:10px;" type="date" name="dataini" id="dataini" onfocus="if(this.value==this.defaultValue)this.value=''" onblur="if(this.value=='')this.value=this.defaultValue" value=<?php echo $partida ?> maxlength="19"/>
<input style="background: url(http://localhost/Azores4YouV2/public/images/calendar.png) no-repeat right center; background-size: 15px 15px;width: 45%;" type="date" name="datafim" id="datafim" onfocus="if(this.value==this.defaultValue)this.value=''" onblur="if(this.value=='')this.value=this.defaultValue" value=<?php echo $regresso ?> maxlength="19"/> <br />
<input style="background: url(http://localhost/Azores4YouV2/public/images/icon.png) no-repeat right center; background-size: 20px 20px;width: 45%;" value=<?php echo $origem ?> name="origem" type="text" id="origem" onfocus="if(this.value==this.defaultValue)this.value=''"
onblur =“if(this.value =='')this.value = this.defaultValue”maxlength =“19”/&gt;
<input style="background: url(http://localhost/Azores4YouV2/public/images/icon.png) no-repeat right center; background-size: 20px 20px;width: 45%;" value=<?php echo $destino ?> type="text" name="destino" onfocus="if(this.value==this.defaultValue)this.value=''"
onblur =“if(this.value =='')this.value = this.defaultValue”maxlength =“19”/&gt;
<label for="numbera"><img src="http://localhost/Azores4YouV2/public/images/person.png" height="40px" width="40px" align="center"/>+11<?php echo $anos ?></label> <input style="margin-top:10px; width: 10%;" type="number" value="1" id="num_adultos" name="num_adultos" readonly />
<input type="button" onclick="incrementValue(num_adultos.id)" value="+" />
<input type="button" onclick="decrementValue(num_adultos.id)" value="-" />
<label for="numberb"><img src="http://localhost/Azores4YouV2/public/images/child.png" height="40px" width="40px"align="center" />2-11<?php echo $anos ?> </label><input style="width: 10%;" type="number" value="0" name="num_menores" id="num_menores" readonly />
<input type="button" onclick="incrementValue(num_menores.id)" value="+" />
<input type="button" onclick="decrementValue(num_menores.id)" value="-" />
<br />
<label for="numberc"><img src="http://localhost/Azores4YouV2/public/images/baby.png" height="25px" width="25px" align="center" style="margin-right: 10px;" /> -2<?php echo $anos ?> </label><input style="width: 10%;" value="0" type="number" name="num_bebes" id="num_bebes" readonly />
<input type="button" onclick="incrementValue(num_bebes.id)" value="+" />
<input type="button" onclick="decrementValue(num_bebes.id)" value="-" />
<br />
<input type="submit" style="background: url(http://localhost/Azores4YouV2/public/images/search.png) no-repeat center; background-size:40px 25px; height: 25px; width: 40px; margin-top:10px;" value="">
注意:datepicker用于dataini和datafim