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?
2 1566
plz explain any1 the following javascript code....... - function MM_findObj(n, d) { //v4.01
-
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
-
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
-
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
-
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
-
if(!x && d.getElementById) x=d.getElementById(n); return x;
-
}
-
-
function MM_validateForm() { //v4.0
-
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
-
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
-
if (val) { nm=val.name; if ((val=val.value)!="") {
-
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
-
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
-
} else if (test!='R') { num = parseFloat(val);
-
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
-
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
-
min=test.substring(8,p); max=test.substring(p+1);
-
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
-
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
-
} if (errors) alert('The following error(s) occurred:\n'+errors);
-
document.MM_returnValue = (errors == '');
Dormilich 8,658
Recognized Expert Moderator Expert
what do you know about Javascript?
PS. the first function is terribly outdated.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Ike |
last post by:
Suppose I have two frames, as shown in the script below. One of the frames,
I would like to have reload every ten minutes or so. Hower, the frame I wish
to reload is a php script, which executes and creates a png image which gets
displayed directly to the browser frame (therefore, the image is NOT written
to the server itself, and the page that gets displayed in the frame I wish
to update is a png image mime type).
How can I amend my...
|
by: qwerty |
last post by:
I´m new to ASP.Net. My workmate has some experience with it.
He claimed that in ASP.Net working with frames is much simpler than it
was ASP. I asked explanation but he couldn't give me such. (a button
inside a-tag with attribute target isn't anything new relating ASP.Net,
its same old HTML).
He claimed that you could change another page´s controls´s property´s
value from another frame by using this method:
' Page "Bottom"
|
by: Microsoft |
last post by:
How do I refer to the content of one frame from another frame.
Depending on which command button is pressed in one frame I wish to chnage
what is displayed in another frame.
Thanks
Colin
|
by: JAW |
last post by:
I have posted this in a couple of the other newsgropus but have not recieved any responses. Thought I would try it here.
I have a frameset that contains frames (top and bottom). In the bottopm frame I have a datagrid, with a command button
on the first column of the grid. When I click on the button for the appropiate row of data, I retreive information from
the row of the datagrid and place this information into session variables for the...
|
by: Bruno |
last post by:
I have a feature that is hosted on a different domain from the primary one
in a frame, and need to retain values in a cookie.
example: A web page at one.com contains a frame which has a page hosted at
two.com
If I view the frameset from one.com in Firefox, all works well with the
content from two.com. But if trying to view this using IE (with standard
security settings), the cookie set by two.com is not accessible.
| |
by: Phlip |
last post by:
Javascripters:
I have a page with an iframe inside. Let's say the iframe looks like this:
<script src="/javascripts/prototype.js" type="text/javascript" />
....
<iframe id='grinder' src='sample.html' >
</iframe>
That prototype.js gives us goodies like $(). And sample.html looks a little
|
by: Phlip |
last post by:
Javascripters:
I have an outer page and an inner iframe. The outer page calculates some
javascript, and wants the inner frame to run it. The inner frame should hit
a page on the same (private) web server, so this is not a cross-site
scripting attack. But I would prefer not to taint the target page with any
extra logic to do this. (I will if I must.)
The calling page has these elements:
|
by: max |
last post by:
Hello,
I am a newbye, and I'm trying to write a simple application.
I have five tables with three columns; all tables are identical; I need to
change some data in the first table and let VB updates the same data in all
other four tables in the right places.
I know it would be possible by using the ForeignKeyConstraint object. I have
created the tables using the DataSet Visual Tool and I know it doesn't
create any ForeignKeyConstraint obj....
|
by: lipa |
last post by:
I'm making a website that's consists entirely of flash . I know how to create a button that functions as a link to another flash frame using the Button selection in the Components window and applying ActionScript. What I do not know how to do is create text within my static text fields that link to another flash frame.
For example, on the main home page I have static text of the latest website update. At the end I want to add a line of static...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |