php如何在表单没提交之前获取文本框的值 php如何在表单没提交之前获取文本框的值?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 能说的详细点吗 或有个详细的代码js和ajax我都不太会 <form action="" methop="post" onSubmit="return check(this)"><input name="name" vlaue="" type="text">...</form><script language="javascript">function check(form) { alert(form.name.value); return false}</script>类似这样····当然还有很多种其它的方法学习js推荐w3school这个网站 挺好 <form action="index.php" method="post" name="PostPdf" id="apLogin"> <fieldset> <legend><span class="STYLE1">用户签单</span></legend> <br> <div class="size"> <label for="Name"><span class="STYLE1">疗养院</span></label> <p> <select name="OrgName" onChange="DoTitle(this.options[this.selectedIndex].value)" id="test"> <option value=""></option> <?php include("conn.php"); $s="select * from hotel order by name"; $res=mysql_query($s,$conn) or die(mysql_error()); $num=''; $name='';while($r=mysql_fetch_array($res)){ if($r['num']==$num){ } else{ $num=$r['num']; $name=$r['name']; ?> <option value="<?php echo $name; ?>" style="font-size:12px;"><?php echo $name; ?></option> <?php } }?> </select> <?php $nm=$_POST['OrgName']; if($nm!=''){ $a="select * from hotel where name = '".$nm."' order by id desc "; $res=mysql_query($a,$conn); $r=mysql_fetch_array($res); if($r['yue']<1000){ echo "此疗养院余额不足1000元,不能签单,请提示其充值!!"; } } ?> <input type="text" name="Group" cols="50" rows="5" readonly="True" style="font-size:9pt;" /> </p> <p> </p> </div> <div class="size"> <label for="password"><span class="STYLE1">日期</span></label> <input type="text" name="date" id="password" size="18" maxlength="15" onFocus="CalendarWebControl.show(this,false,this.value);" /><br /><br> </div> <label for="password"><span class="STYLE1">人数</span></label> <p> <input type="text" name="num" id="num" size="18" maxlength="15" onBlur="return getdata()"/> </p> <p><br /> <?php $person=$_POST['num']; $date=$_POST['date']; $s1="select * from hotel where name='".$nm."'"; $res1=mysql_query($s1,$conn); $r1=mysql_fetch_array($res1); $zero2="2011-6-30"; $zero3="2011-9-1"; if(strtotime($date)<strtotime($zero2)||strtotime($date)>strtotime($zero3)){$price=$r1['dprice'];//echo $price;}else if(strtotime($date)>strtotime($zero2)&&strtotime($date)<strtotime($zero3)&&$num<10){$price=$r1['wprice'];}else if(strtotime($date)>strtotime($zero2)&&strtotime($date)<strtotime($zero3)&&$num>10){$price=$r1['rprice'];}?> <span class="STYLE5">单价</span> <input type="text" name="jiaqian" value="<?php echo $price; ?>"> </p> <input name="button" type="submit" class="buttom" value="提交" /> </fieldset> </form> 以上是我的代码 在没提交之前 $_POst post不出来 $_POST在PHP中如果没有提交,当然不会有内容你这种check,应该用ajax,而不是用php的$_POST处理! 我该怎样用ajax啊?请详细指点 经典的笛卡尔乘积代码,要怎么修改它? 大家一起来学习吧!PHP群:29625371 jsp重要还是php重要 smarty 缓存控制问题会的告诉我为什么报错 有什么方法将远程图片地址加密或者转换其他编码 PHP smarty模板嵌套 php4.4.7中fopen访问http不能带端口? str过滤问题.如果过滤掉像:"你妈的"这些赃话. 初级问题: !$变量名 总提示 undefinded PHP Warning: PHP Startup: in Unknown on line 0 请教一个关于MYSQL全文搜索的问题.. 午夜求解,
js和ajax我都不太会
<form action="" methop="post" onSubmit="return check(this)">
<input name="name" vlaue="" type="text">...
</form>
<script language="javascript">
function check(form) {
alert(form.name.value);
return false
}
</script>类似这样····当然还有很多种其它的方法
学习js推荐w3school这个网站 挺好
<fieldset>
<legend><span class="STYLE1">用户签单</span></legend>
<br>
<div class="size">
<label for="Name"><span class="STYLE1">疗养院</span></label>
<p>
<select name="OrgName" onChange="DoTitle(this.options[this.selectedIndex].value)" id="test">
<option value=""></option>
<?php
include("conn.php");
$s="select * from hotel order by name";
$res=mysql_query($s,$conn) or die(mysql_error());
$num='';
$name='';
while($r=mysql_fetch_array($res)){
if($r['num']==$num){
}
else{
$num=$r['num'];
$name=$r['name'];
?>
<option value="<?php echo $name; ?>" style="font-size:12px;"><?php echo $name; ?></option>
<?php } }?>
</select>
<?php
$nm=$_POST['OrgName'];
if($nm!=''){
$a="select * from hotel where name = '".$nm."' order by id desc ";
$res=mysql_query($a,$conn);
$r=mysql_fetch_array($res);
if($r['yue']<1000){
echo "此疗养院余额不足1000元,不能签单,请提示其充值!!";
}
}
?>
<input type="text" name="Group" cols="50" rows="5" readonly="True" style="font-size:9pt;" />
</p>
<p> </p>
</div>
<div class="size">
<label for="password"><span class="STYLE1">日期</span></label>
<input type="text" name="date" id="password" size="18" maxlength="15" onFocus="CalendarWebControl.show(this,false,this.value);" /><br /><br>
</div>
<label for="password"><span class="STYLE1">人数</span></label>
<p>
<input type="text" name="num" id="num" size="18" maxlength="15" onBlur="return getdata()"/>
</p>
<p><br />
<?php $person=$_POST['num'];
$date=$_POST['date'];
$s1="select * from hotel where name='".$nm."'";
$res1=mysql_query($s1,$conn);
$r1=mysql_fetch_array($res1);
$zero2="2011-6-30";
$zero3="2011-9-1";
if(strtotime($date)<strtotime($zero2)||strtotime($date)>strtotime($zero3)){
$price=$r1['dprice'];
//echo $price;
}else if(strtotime($date)>strtotime($zero2)&&strtotime($date)<strtotime($zero3)&&$num<10){
$price=$r1['wprice'];}
else if(strtotime($date)>strtotime($zero2)&&strtotime($date)<strtotime($zero3)&&$num>10){
$price=$r1['rprice'];
}?>
<span class="STYLE5">单价</span>
<input type="text" name="jiaqian" value="<?php echo $price; ?>">
</p>
<input name="button" type="submit" class="buttom" value="提交" />
</fieldset>
</form>