×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

@

请教:为什么jsp里面可以看见<input type="text" name="email">的值,却看不见<input type="radio" name="vip">的值呢? email.value没有问题,但是vip.value却说没定义。

本文发表在 rolia.net 枫下论坛<script type="text/javascript">
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
{alert(alerttxt);return false}
else {return true}
}
}

function validate_form(thisform)
{
with (thisform)
{
<% if (mode[0]==1) {%>
alert("-"+vip.value+"-");
if (validate_required(vip,"VR must be filled out!")==false)
{vip.focus();return false}
<% } %>
if (validate_required(email,"Email must be filled out!")==false)
{email.focus();return false}
}
}
</script>

<form method="post" action="" onsubmit="return validate_form(this)">
<input value="V1" name="vip" type="radio">
<input name="vip" value="V2" type="radio"></font></span>
<input name="vip" value="V3" type="radio">VMP 1 - PiPe PRO - Full
<input name="vip" value="V4" type="radio">VMP 4 - PiPe PRO -
<input name="vip" value="V5" type="radio"></font>VMP 5 - PiPe PRO -
<td dir="ltr" style="margin-top: 0pt; margin-bottom: 0pt;" height="46" valign="top" width="482">
<input name="email" size="63" maxlength="60" type="text"></font></p>更多精彩文章及讨论,请光临枫下论坛 rolia.net
Report

Replies, comments and Discussions:

  • 工作学习 / 专业知识杂谈 / 请教:为什么jsp里面可以看见<input type="text" name="email">的值,却看不见<input type="radio" name="vip">的值呢? email.value没有问题,但是vip.value却说没定义。
    本文发表在 rolia.net 枫下论坛<script type="text/javascript">
    function validate_required(field,alerttxt)
    {
    with (field)
    {
    if (value==null||value=="")
    {alert(alerttxt);return false}
    else {return true}
    }
    }

    function validate_form(thisform)
    {
    with (thisform)
    {
    <% if (mode[0]==1) {%>
    alert("-"+vip.value+"-");
    if (validate_required(vip,"VR must be filled out!")==false)
    {vip.focus();return false}
    <% } %>
    if (validate_required(email,"Email must be filled out!")==false)
    {email.focus();return false}
    }
    }
    </script>

    <form method="post" action="" onsubmit="return validate_form(this)">
    <input value="V1" name="vip" type="radio">
    <input name="vip" value="V2" type="radio"></font></span>
    <input name="vip" value="V3" type="radio">VMP 1 - PiPe PRO - Full
    <input name="vip" value="V4" type="radio">VMP 4 - PiPe PRO -
    <input name="vip" value="V5" type="radio"></font>VMP 5 - PiPe PRO -
    <td dir="ltr" style="margin-top: 0pt; margin-bottom: 0pt;" height="46" valign="top" width="482">
    <input name="email" size="63" maxlength="60" type="text"></font></p>更多精彩文章及讨论,请光临枫下论坛 rolia.net
    • 你用一个名字定义了多个radio, 访问时用数组, 如 vip[0] ...