php如何在表单没提交之前获取文本框的值??
解决方案 »
- 学习PHP中,想了解下如何制作一个完整项目的,从最初构思到框架搭建,到程序编写,有这方面的书籍或者视频吗?
- 在linux下开发PHP,用哪个系统?
- 如何用PHP把1000多个.txt文件导出到MYSQL数据库
- 重新安装php后程序出现大问题
- 写了段代码,不知道该如何理解面向对象的继承
- 纠结,原生PHP很熟练,还有没有必要去学ThinkPHP?
- 如何用mail函数进行群发邮件
- 另开一帖:如何提高PHP程序的复用,如何降低偶合,提高内聚
- 有没有人告诉我开发文档里面程序流程逻辑要怎么写啊?
- php 怎么 实现从数据库随机取出10条数据 按某个字段数量优先
- 请教一个关于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>