Quick login...
 

 

  

DNN Modules
SnowCovered Top Sellers

Ultra Media Gallery is the most popular photo gallery and media gallery solution for DotNetNuke, UMG offers 10 different flash player to browse your gallery with completely different user interface experience.

Powerful, Ajax Enabled, Easy to Use. Document Management and Multimedia gallery functionality in one.Open-DocumentLibrary allows DotNetNuke users to organize share and manage documents, offering granular control over Folder and Document access.

Active Social is customizable social networking solution that fits the needs of a large company, small group, start-up business, or any size interest group. Connect with co-workers, people with similar interests, family, old friends, or meet new ones. Active Social provides a complete communication

Frustrated over the lack of customization for your user's registration fields? Dynamically setup your DNN Portal with custom registration fields, layout, questions, and other core integration options......

In this day and age, knowing as much detailed information as possible about your customer, prospect or web site user is essential. Thankfully, the new 'Dynamics Forms' module from Data Springs, makes it easier than ever to segment your data collection efforts.

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to upload videos in various format and automatically encode them to flv or H264 format, you also can add videos from internet and play them in our integrated flash video player.

One stop solution for events calendar and events registration! FREE DOWNLOAD is available now!

The amazing ANY COLOUR Flex2 skin + our unique EasyMod module allowing you to customise just about everything in this skin. DrNuke just re-wrote the rule book again.

The Future of Enterprise Search for DotNetNuke 3.x and 4.xOpen-SearchEngine provides DotNetNuke with a true enterprise search engine capable of indexing html content as well as documents from multiple sites and/or physical directories.

Capture your users attention, enrich your site with multimedia flash, and create and opt in distribution list for your DNN site. These are just a few of the many features the Data Springs Module Collection can provide you.

Recently Viewed...
DNN Modules
   
    |   Register   |   Tuesday, March 16, 2010   
Hi Everyone!

You'll notice that we implemented a small change where your first and last name are now displaying in the forums.  If you do not wish to display your last name, please update your user profile and add a display name.  You'll find this by clicking on your name at the top of the page (right next to the Logout link).  Thanks!

Data Springs Product Forums...
Subject: Dynamic Javascript Function to run onload of page
Prev Next
You are not authorized to post a reply.

Author Messages
Craig Lambie
Posts:80
river guide
river guide

06/23/2009 1:38 AM  

Hi

I would like a dynamic JS function to run, based on the content of a Dynamic Field, it shows a Div in a HTML field, and hides the others.

At the moment they are all staying hidden until I click on the field that changes them.

I would like the JS to run, based on the fields value at load of page.  How to tell JS which field it is dynamically?

Thanks

C

David To
Posts:2120
river guide
river guide

06/23/2009 7:33 AM  
Hi Craig, try going to JS function under Module Configuration / Javascript / Custom Javascript File and place it in the Initial Javascript. That way, the JS function will run on page load. See if this works for you. -- David
Craig Lambie
Posts:80
river guide
river guide

06/23/2009 7:48 AM  

Hi David,

The issue is the dynamic field ID.

If I put

function test($(ShortFieldName_FieldID) {

}

will that work?? I don't think so.

I need to dynamically tell it the field ID, or hard code it in??

C

David To
Posts:2120
river guide
river guide

06/23/2009 8:55 AM  
HI Craig, check out some of the functions under Custom Javascript file. If you place your functions there, you should be able to use a variable name. Then you call the function passing the $(ShortFieldName_FieldID) token value in the initial page load. -- David
Craig Lambie
Posts:80
river guide
river guide

06/23/2009 3:45 PM  
Ok, so as suspected, the funtion doesn't appear to work.
ShortFieldName = AccountType
Mind, the JS is not erroring, so I would suspect it is using the standard $function which is document.getElementById(
??? How do I tell the function to run, and tell it the ASPX ClientID of AccountType?
------------------js extract-------------

//onload function to run
shHTML($(AccountType_FieldID));

function shHTML(varAcTypeID) {


var vC1 = $('Consumer1');
var vC2 = $('Consumer2');
var vB1 = $('Biz1');
var vB2 = $('Biz2');
var vB3 = $('Biz3');
var AcType = $(varAcTypeID);
var vP = $('Promo');


showhtml(vP.id);

//Handle Changed Account Type
switch (AcType.options[AcType.selectedIndex].value) {
case 'Consumer - Free':
showhtml(vC1.id);
hidehtml(vC2.id); hidehtml(vB1.id); hidehtml(vB2.id); hidehtml(vB3.id);
break;
case 'Consumer - Full Registered':
showhtml(vC2.id);
hidehtml(vC1.id); hidehtml(vB1.id); hidehtml(vB2.id); hidehtml(vB3.id);
break;
case 'Business - Standard':
showhtml(vB1.id);
hidehtml(vC2.id); hidehtml(vC1.id); hidehtml(vB2.id); hidehtml(vB3.id);
break;
case 'Business - Gold':
showhtml(vB2.id);
hidehtml(vC2.id); hidehtml(vB1.id); hidehtml(vC1.id); hidehtml(vB3.id);
break;
case 'Business - Platinium':
showhtml(vB3.id);
hidehtml(vC2.id); hidehtml(vB1.id); hidehtml(vB2.id); hidehtml(vC1.id);
break;
default:
break;
} //end Switch

} //end ShowHideHTML
Craig Lambie
Posts:80
river guide
river guide

06/23/2009 4:10 PM  
just had a thought, that maybe you meant I could create another field, with a client event, onload, but this is not on of the available keywords for the events.
David To
Posts:2120
river guide
river guide

06/24/2009 6:19 AM  
Hi Craig, at page load, what is the actual field value of AccountType? Is there a default value? Also, if you use Firefox, can you download and install Firebug to trace through the javascript code and see what value it is actually seeing, if any? -- David
You are not authorized to post a reply.
Forums > Product Discussion - DotNetNuke Modules > Dynamic Registration > Dynamic Javascript Function to run onload of page



ActiveForums 3.7
Copyright 2005 - 2010 by Data Springs, Inc.
Terms Of Use | Privacy Statement