First in the JSP page to judge and then jump __jsp

Source: Internet
Author: User

The effect of this example is that the selected value will pop up when any one of the radio boxes is chosen, and then jump to others.do;
When you do not select any of the radio boxes only pop-up prompts, do not jump, but stay on this page.

<script language= "JAVASCRIPT" >
<!--
function Check () {
var flag=0;
for (i=0;i<document.lin.r.length;i++) {
if (document.lin.r[i].checked) {
Alert ("Checked R" + (I+1));
flag=1;
return true;
}
}
if (flag==0) {
Alert ("no element checked");
return false;
}
}
-->
</SCRIPT>

<form name= "Lin" action= "others.do" >
<input type= "Radio" name= "R" > Left <input type= "Radio" name= "R" > Right <br/>
<input type= "Submit" value= "submitted" onclick= "return Check ()"/>
</from>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.