Recently Viewed...
DNN Modules
SnowCovered Top Sellers

Live Content uses Web 2.0 approach to provide a Rich User Interface and streamlines content presentation by overlaying content on current page. Overlay images, videos, audio, text/html content, flash, dotnetnuke modules, and external content. Experience the demo...

Gloss is the first ALL COLORS! skin, featuring a powerful XML-based flash and being 100% W3C CSS XHMTL1.0 compliant. Tune it yourself on the fly, changing colors, backgrounds, containers, text color and size, width and more! Brilliant!

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

'Relationship Building' and 'Communication' are two essential nuts and bolts for a business to prosper. This module allows you to bridge both of these and easily generate continuous awareness of your web site, products and services. Your prospects and customers will greatly appreciate this featur

Powerful, Ajax Enabled, Easy to Use. Document Management has never been better. Open-DocumentLibrary allows DotNetNuke users to share and manage documents in a flexible, intelligent way, offering granular control over Folder and Document access.

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 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.

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.

The Catalyst skins are professionally designed, coded and packaged by a team of DotNetNuke experts. The skins are available in 12 great colours. This skin is easily customisable with our unique DrNuke EasyMod technology. Try our demo!

ALL NEW ! - Minimalist includes skin packs in 12 great colors. Each color has Flat, Gradient and Glass versions. Feature rich XML Flash header, perfect for just about any purpose. 9 Different menu options in each skin pack; 3 horizontal menus, 3 vertical menus and 3 all-new Twin level menus . . .

    |   Register   |   Thursday, December 04, 2008   
Data Springs Product Forums...
Subject: Custom javascript in form
Prev Next
You are not authorized to post a reply.

Author Messages
Brian
Posts:8
skipping stones
skipping stones

05/17/2008 7:22 PM  

Hi,

 

I have a custom form whereby users use it to register for a conference.

 

The user fees should be calculated based on several items:

1) If the user filled in their details there is a count of 1 * $80

2) If the user filled in their Spouse details then there is now an additional count bring the user count to 2 * $80

3) If they add their youth then again another count of 1.

4) If they add their children and specify an age of 5 or less then an additional charge of $5 per child, if they specify an age of 6-12 then an additional charge of $30 per child.

My variable is a hidden field called $(Fees). Not working for me, how do I do this properly.

Thanks,
Brian

Brian
Posts:8
skipping stones
skipping stones

05/18/2008 8:47 AM  
I've playing around with Question Events and the default onblur event doesn't seem to fire my event. Am I missing something?

I've tried add a new javascript function to the Custom Javascript section called setTotal like this:

In the Custom Javascript file:

function setTotal()
{
alert(document.getElementById('Total').value);
}

In my Question Event:

setTotal();

Am I doing something wrong? My field name is Total, but this event never get's called which I'm assuming will happen when the onblur (user leaves the field) action is performed.

Need Help!!!

Thanks,
Brian
Chad
Posts:2271
river guide
river guide

05/19/2008 3:47 PM  

Brian,

I am assuming you when say 'Question Event', are you are referring to the onblur client side events area right?

A few things... Dynamic Forms generates several references to form fields that can be used and executed. In this case you either need to pass a field to the setTotal function, or you need to just perform the calculation in the main client side event for the field. The module can redern $(ShortFieldName) to its actual value, or ID... Such as these examples:

$(ShortFieldName) - Used to get or set the value
$(ShortFieldName_Field) - Referenced the field
$(ShortFieldName_FieldID) - Referenced the field ID
$(ShortFieldName_ValueFieldID) - only referenced or used within multi field items such as checkbox group or list fields etc...

So... Something like this:
alert(document.getElementById('$(Total_FieldID)').value);

This is assuming the short field name was total for that field.

Basically, it looks like you are referencing 'total' but the ID of that field is much more complicated in ASP.NET when its rendered to the page. rendered with a very long name that is generated.

There are other things to make note of as well, if you don't need to generate it client side and want to generate it server side there is a token that is used within Authorizenet and PayPal integrate called $(Calc_TotalField). This field will render calculations that you enter into the 'Total field' within the payment gateway. For example:

($(Field1) + $(Field2)) * 10

etc...

A couple other comments... If you are signed in as the admin and you add ?Debug=True you should see 'exactly' what is being rendered to the onblur or client side javascript that is being executed. So I would run this test to see what is happening.

Additionally - These are great forum threads that we are happy users continue to add, comment, and help each other out for implementations. As each client side event can be very custom we do not offer direct support for client side javascript itself, however we do offer premium support hours that can include implementation / support if you need more direct assistance.


-Chad
 

Brian
Posts:8
skipping stones
skipping stones

05/21/2008 1:15 PM  

Hi Chad,

 

Thanks for the reply, I managed to get it working, though there are some wierd caching issues in the module that causes a new field I added to not give me the FieldID to pass to a javascript function. I tried all ways to get it to work, finally I just did a view source and copied and pasted the ID that was in the page, so far it hasn't broke.

 

Now, all of a sudden, the email fields are not working 100%, showing no entries for certain fields on my forms. The only thing I did was put a client side call to my javascript in the fields, now half the fields show a value when sending the email and the other half do not. Any bug fix I should be aware of?

I checked on Snowcovered but don't see any patches for 2.6, is there a newer update?

Further, I tried to use an SQL event and it is not working either. I created a new table in the DNN database, added my fields, tested adding data and it worked from the SQL query window. I then tried inserting data from the event and I don't even get an error code. How do I debug this? I have a mixture of integers and strings to insert into a table.

Any help is appreciated.

Cheers,

Brian

Chad
Posts:2271
river guide
river guide

05/23/2008 12:30 PM  
Brian,

Hi. I believe I just sent you the latest and greatest version of 2.6 with all known patches and fixes. We are still testing this latest build against all known issues and should have a fix posted on Snowcovered by the end of next week.

-Chad
You are not authorized to post a reply.



ActiveForums 3.7

Copyright 2005 - 2008 by Data Springs, Inc.
Terms Of Use | Privacy Statement