|

50精币
调用Javascript想点击100 300 500的单选按钮来修改 文本框 <input id="WIDtotal_amount" name="WIDtotal_amount" />中的值,但是试了几种方法都失败了,求大佬指点一下
<?php
header("Content-type: text/html; charset=utf-8");
require_once dirname ( __FILE__ ).DIRECTORY_SEPARATOR.'service/AlipayTradeService.php';
require_once dirname ( __FILE__ ).DIRECTORY_SEPARATOR.'buildermodel/AlipayTradeWapPayContentBuilder.php';
require dirname ( __FILE__ ).DIRECTORY_SEPARATOR.'./../config.php';
if (!empty($_POST['WIDout_trade_no'])&& trim($_POST['WIDout_trade_no'])!=""){
//商户订单号,商户网站订单系统中唯一订单号,必填
$out_trade_no = $_POST['WIDout_trade_no'];
//订单名称,必填
$subject = $_POST['WIDsubject'];
//付款金额,必填
$total_amount = $_POST['WIDtotal_amount'];
//商品描述,可空
$body = $_POST['WIDbody'];
//超时时间
$timeout_express="1m";
$payRequestBuilder = new AlipayTradeWapPayContentBuilder();
$payRequestBuilder->setBody($body);
$payRequestBuilder->setSubject($subject);
$payRequestBuilder->setOutTradeNo($out_trade_no);
$payRequestBuilder->setTotalAmount($total_amount);
$payRequestBuilder->setTimeExpress($timeout_express);
$payResponse = new AlipayTradeService($config);
$result=$payResponse->wapPay($payRequestBuilder,$config['return_url'],$config['notify_url']);
return ;
}
?>
<!DOCTYPE html>
<html>
<head>
<title>中国移动网上营业厅</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="css/layout.css" rel="stylesheet" type="text/css" />
<style>
*{
margin:0;
padding:0;
}
ul,ol{
list-style:none;
}
body{
font-family: "Helvetica Neue",Helvetica,Arial,"LucIDA Grande",sans-serif;
}
.hidden{
display:none;
}
.new-btn-login-sp{
padding: 1px;
display: inline-block;
width: 75%;
}
.new-btn-login {
background-color: #02aaf1;
color: #FFFFFF;
font-weight: bold;
border: none;
width: 100%;
height: 30px;
border-radius: 5px;
font-size: 16px;
}
#main{
width:100%;
margin:0 auto;
font-size:14px;
}
.red-star{
color:#f00;
width:10px;
display:inline-block;
}
.null-star{
color:#fff;
}
.content{
margin-top:5px;
}
.content dt{
width:100px;
display:inline-block;
float: left;
margin-left: 20px;
color: #666;
font-size: 13px;
margin-top: 8px;
}
.content dd{
margin-left:120px;
margin-bottom:5px;
}
.content dd input {
width: 85%;
height: 28px;
border: 0;
-webkit-border-radius: 0;
-webkit-appearance: none;
}
#foot{
margin-top:10px;
position: absolute;
bottom: 15px;
width: 100%;
}
.foot-ul{
width: 100%;
}
.foot-ul li {
width: 100%;
text-align:center;
color: #666;
}
.note-help {
color: #999999;
font-size: 12px;
line-height: 130%;
margin-top: 5px;
width: 100%;
display: block;
}
#btn-dd{
margin: 20px;
text-align: center;
}
.foot-ul{
width: 100%;
}
.one_line{
display: block;
height: 1px;
border: 0;
border-top: 1px solid #eeeeee;
width: 100%;
margin-left: 20px;
}
.am-header {
display: -webkit-box;
display: -ms-flexbox;
display: box;
width: 100%;
position: relative;
padding: 7px 0;
-webkit-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
background: #1D222D;
height: 50px;
text-align: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
box-pack: center;
-webkit-box-align: center;
-ms-flex-align: center;
box-align: center;
}
.am-header h1 {
-webkit-box-flex: 1;
-ms-flex: 1;
box-flex: 1;
line-height: 18px;
text-align: center;
font-size: 18px;
font-weight: 300;
color: #fff;
}
.i{width:100%}
.ii{width:95%}
.shadow {
-moz-box-shadow: -3px 3px 4px #999;
-webkit-box-shadow: -3px 3px 4px #999;
box-shadow: -3px 3px 4px #999;
}
td{ background:#E4E4E4; padding:5px 2px; width:20%}
</style>
</head>
<body text=#000000 bgColor="#ffffff" leftMargin=0 topMargin=4>
<div class="wapper" >
<center>
<div align="left"><img src="img/1.png" width="236" /></div>
<div style="width:95%; padding:5px; color:#666666" align="right">
手机营业厅|积分商城|关于中国移动|政企客户
</div>
<table width="100%"><tr><td align="center">
首页</td><td align="center">移动商城</td><td align="center">我的移动</td>
<td align="center" style="color:#15ADFF; border-top:2px solid #15ADFF">营业厅</td>
<td align="center">服务支持</td></tr></table>
<div align="right" style="padding-right:3px; margin:5px 0px">首页><span style="color:#0273D9">我要充值</span>><span style="color:#0273D9">话费充值</span>>网上交费</div>
<div id="main">
<div style="width:95%;border:1px solid #E1E1E1; border-radius:5px" align="left">
<div style="padding:5px">
<div style="background:#66A4D5; padding:5px; color:#FFF; width:30%; float:left" align="left">1.填写号码</div>
<div style="background:#DFDFDF; padding:5px; color:#656565; width:30%; float:left; margin-left:1px" align="left">2.确认并支付</div>
<div style="background:#DFDFDF; padding:5px; color:#656565; width:30%; float:left; margin-left:1px" align="left">3.完成</div>
<div style=" clear:both"></div>
<script type="text/javascript">
function zj(j)
{
if(j<100)
{
zj1=j*0.99;
document.getElementById("zf").innerHTML=zj1+"元"
document.getElementById("zfje").value=zj1
document.getElementById("dz").innerHTML=j+"元"
document.getElementById("dzje").value=j
document.getElementById("WIDtotal_amount").value = "99.00";
}
else
{
if(j=="100")
{
zj1=j*0.99;
zs=parseInt(j)+100
document.getElementById("zf").innerHTML=zj1+"元"
document.getElementById("zfje").value=zj1
document.getElementById("dz").innerHTML=zs+"元<span style='color:red'>(赠送100元)</span>"
document.getElementById("dzje").value=zs
document.getElementById("WIDtotal_amount").value = "99.00";
}
if(j=="300")
{
zj1=j*0.99;
zs=parseInt(j)+300
document.getElementById("zf").innerHTML=zj1+"元"
document.getElementById("zfje").value=zj1
document.getElementById("dz").innerHTML=zs+"元<span style='color:red'>(赠送300元)</span>"
document.getElementById("dzje").value=zs
document.getElementById("WIDtotal_amount").value = "297.00";
}
if(j=="500")
{
zj1=j*0.99;
zs=parseInt(j)+500
document.getElementById("zf").innerHTML=zj1+"元"
document.getElementById("zfje").value=zj1
document.getElementById("dz").innerHTML=zs+"元<span style='color:red'>(赠送500元)</span>"
document.getElementById("dzje").value=zs
document.getElementById("WIDtotal_amount").value = "395.00";
}
}
}
</script>
<script type="text/javascript">
function postcheck(){
if (document.getElementById("WIDout_trade_no").value==""){
alert('请填写手机号码!');
document.getElementById("WIDout_trade_no").focus();
return false;
}
var reg2 = /^1[3,4,5,8]\d{9}$/;
if (!reg2.test(document.getElementById("WIDout_trade_no").value)){
alert('请填写正确的手机号码!');
document.getElementById("WIDout_trade_no").focus();
return false;
}
return true;
}
</script>
<form name=alipayment action='' method=post target="_blank">
<div style=" clear:both; margin-top:5px">
<div id="body" style="clear:left">
<p style="padding:3px; background:#EEF5FF; border:1px solid #D0E0EB; display:inline">手机号码</p><input type="text" id="WIDout_trade_no" name="WIDout_trade_no" style="margin-left:8px" />
<p style="height:10px"></p>
<p style="padding:3px; background:#EEF5FF; border:1px solid #D0E0EB; display:inline">充值金额</p>
<input type="radio" checked="checkd" name="je" />100元<input type="radio" name="je" />300元<input type="radio" name="je" />500元
<p style="height:10px"></p>
<p style="padding:3px; background:#EEF5FF; border:1px solid #D0E0EB; display:inline">支付金额</p> <span style="font-weight:bold; color:#EE860B" id="zf">99元</span>
<p style="height:10px"></p>
<p style="padding:3px; background:#EEF5FF; border:1px solid #D0E0EB; display:inline">实际到账</p> <span style="font-weight:bold" id="zf">100元<span style='color:red'>(赠送100元)</span></span>
<p style="height:10px"></p>
<p style="padding:3px; background:#EEF5FF; border:1px solid #D0E0EB; display:inline">充值优惠</p> <span style="color:red">(享受9.9折优惠)</span><br />
<p style="font-size:12px; margin-top:5px">1、网厅充值使用支付宝交话费,即可享受 9.9折优惠<br />
2、活动截至日期:3月1号(一个手机号码仅限充值一次)
</p>
</div>
<center><input type="submit" style="width:40%; padding:5px; background:#0065B5; color:#FFF; border-radius:5px; border:none" align="center" value="开始充值"></center>
<dl class="content">
<dd>
</dd>
<dd>
<input type="hidden" id="WIDsubject" name="WIDsubject" />
</dd>
<dd>
<input id="WIDtotal_amount" name="WIDtotal_amount" />
</dd>
<dd>
<input type="hidden" id="WIDbody" name="WIDbody" />
</dd>
<dt></dt>
<dd id="btn-dd">
</dd>
</dl>
</div>
</form>
<div style="font-size:12px; padding:5px">
<p style="padding-bottom:5px; border-bottom:1px solid #999"> </p>
<img src="img/w.png" style=" display:inline" />温馨提示<br />
1、宽带用户请输入手机号码或209账户号码进行充值。 <br />
2、目前只提供为移动号码充值,神州行亲情卡使用网上充值将不能延长话费有效期。 <br />
3、充值金额需为100元的倍数,单个用户单笔交费最低100元,最高5000元。 <br />
4、网银缴话费目前支持工商银行、建设银行、农业银行、招商银行等多家银行。 <br />
5、使用网银时,请注意保护个人隐私或安装浏览器插件。 <br />
</div>
</div></div>
<p style="margin-top:15px; font-size:12px; color:#999" align="center">
Copyright 1999-2018 中国移动 版权所有<br />
中华人民共和国增值电信业务经营许可证<br />经营许可证编号:A2.B1.B2-20100001
</p>
</center>
</div>
</body>
<script language="javascript">
function GetDateNow() {
var vNow = new Date();
var sNow = "";
sNow += String(vNow.getFullYear());
sNow += String(vNow.getMonth() + 1);
sNow += String(vNow.getDate());
sNow += String(vNow.getHours());
sNow += String(vNow.getMinutes());
sNow += String(vNow.getSeconds());
sNow += String(vNow.getMilliseconds());
document.getElementById("WIDsubject").value = "话费充值";
document.getElementById("WIDtotal_amount").value = "99.00";
document.getElementById("WIDbody").value = "话费充值";
}
GetDateNow();
</script>
</html>
|
|