我需要在jsp中显示弹出窗口。代码如下。
<form:form method="post" commandName="transactionDetails"
align="center">
<form:radiobutton path="plan" value="0" label="prepaid" />
<form:radiobutton path="plan" value="1" label="postpaid" />
<br>
<br>Mobile Number : <br>
<form:input path="mobile" />
<br>
<br>
Operator <br>
<form:select path="operator">
<form:option value="Select operator">Select Operator</form:option>
<form:option value='Aircel'>Aircel</form:option>
<form:option value='Airtel'>Airtel</form:option>
<form:option value='BSNL'>BSNL</form:option>
<form:option value='Idea'>Idea</form:option>
<form:option value='MTNL'>MTNL</form:option>
<form:option value='MTS'>MTS</form:option>
<form:option value='Loop Mobile'>Loop Mobile</form:option>
<form:option value='Reliance CDMA'>Reliance CDMA</form:option>
<form:option value='Reliance GSM'>Reliance GSM</form:option>
<form:option value='S Tel'>S Tel</form:option>
<form:option value='Tata DOCOMO'>Tata Docomo GSM</form:option>
<form:option value='Tata Indicom'>Tata Docomo CDMA</form:option>
<form:option value='Uninor'>Uninor</form:option>
<form:option value='Videocon'>Videocon</form:option>
<form:option value='Virgin GSM'>Virgin GSM</form:option>
<form:option value='Virgin CDMA'>Virgin CDMA</form:option>
<form:option value='Vodafone'>Vodafone</form:option>
<form:option value='Cheers'>Cheers</form:option>
<form:option value='Ping'>Ping</form:option>
</form:select>
<br>
<br> Amount <br>:
<form:input path="amount" />
<br>
<br>
<input type="submit" class="btn" value="Proceed to recharge">
现在,当用户单击选择运算符时,它应显示特定运算符具有的计划。 我正在使用spring mvc。
类似于paytm ..
答案 0 :(得分:0)
OnChange of operator call javascript function as
<form:select path="operator" id="operator" onChange="SelectOperator();">
<form:option value="Select operator">Select Operator</form:option>
<form:option value='Aircel'>Aircel</form:option>
......
</form:select>
编写javascript函数,打开弹出窗口,调用Spring Controller并将此运算符作为
传递<Script language="javascript">
function SelectOperator() {
var opr = document.getElementById("operator").value;
window.open("NEWPOPUP","/controllerURL?operator="+opr);
}
</script>
从此控制器返回的任何页面都将作为弹出窗口打开。