469,325 Members | 1,661 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,325 developers. It's quick & easy.

How do I create a frame in which I can update the source of another frame?

I need my users to be able to change the source of a frame. The best example of this is here:
Tryit - W3schools "Tryit Editor"

Is there any way I can accomplish this?
Sep 21 '09 #1
2 1446
plz explain any1 the following javascript code.......

Expand|Select|Wrap|Line Numbers
  1. function MM_findObj(n, d) { //v4.01
  2.   var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  3.     d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  4.   if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  5.   for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  6.   if(!x && d.getElementById) x=d.getElementById(n); return x;
  7. }
  8.  
  9. function MM_validateForm() { //v4.0
  10.   var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  11.   for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
  12.     if (val) { nm=val.name; if ((val=val.value)!="") {
  13.       if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
  14.         if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
  15.       } else if (test!='R') { num = parseFloat(val);
  16.         if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
  17.         if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
  18.           min=test.substring(8,p); max=test.substring(p+1);
  19.           if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
  20.     } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  21.   } if (errors) alert('The following error(s) occurred:\n'+errors);
  22.   document.MM_returnValue = (errors == '');
Sep 21 '09 #2
Dormilich
8,651 Expert Mod 8TB
what do you know about Javascript?

PS. the first function is terribly outdated.
Sep 21 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Ike | last post: by
3 posts views Thread by Microsoft | last post: by
17 posts views Thread by Bruno | last post: by
16 posts views Thread by Phlip | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.