Using JavaScript to get the values in an IFRAME sample code _javascript Tips

Source: Internet
Author: User
Copy Code code as follows:

<script type= "Text/javascript" language= "JavaScript" >
function CCCC () {
var file_name= "";
var count=0;
if (Document.frames ("MyFrame"). Document.all.length) {
for (Var i=0;i<document.all.length;i++) {
if (Document.frames ("MyFrame"). document.all (i). Type = = ' checkbox ' && document.frames ("MyFrame"). document.all (i). checked== true) {
File_name=document.frames ("MyFrame"). document.all (i). value;
alert (file_name);
count++;
}
}
}
if (count==1) {
var url= "<%=path%>/attssss?" File_name= "+file_name;
var returnvalue=showmodaldialog (URL, "Attssss", "dialogwidth:700px;dialogheight:500px;dialogleft:400px;dialogtop : 200px;center:yes;help:yes;resizable:yes;status:yes ");
if (returnvalue) {
Window.location.href= window.location.href;
}
}
else if (count<1) {
Alert (' You have not selected the information, please click the mouse on the item you want to select! ');
}
else{
Alert (' Only one message can be selected at a time! ');
}
}
</script>

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.