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   |   Wednesday, March 17, 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: Strange Behavior - Client Side Script, Question Events
Prev Next
You are not authorized to post a reply.

Author Messages
Dan Stauffer
Posts:53
river guide
river guide

06/23/2009 11:55 AM  

I am trying to hide/show a payment method field based on the amount due.  I have 2 payment methods (PayPal and Pay by Check).

I want to hide the Payment Method Field if the amount due is greater than $1500.

I set up a Question Event that is to Hide based on a Hidden Field Value of 1 and Show with a Value of 0.

I set the Hidden field value with a client side script

if ($(GrandTotal) > 1500){
$(NoPayPal) = 1;}
else{
$(NoPayPal) = 0;}

(NoPayPal is the hidden field that triggers the Question Event to Hide the Payment Method Field)

I can get the hide to occur but it is delayed by a refresh.  The first time the amount exceeds 1500 but it does not hide.  If the amount exceeds 1500 for a second time it hides.  Same thing happens with Show.  The first time the amount drops below 1500 it does not Show but the second time it Shows.

Does this make sense?  any suggestions?

Thanks, Dan

Dan Stauffer
Posts:53
river guide
river guide

06/23/2009 12:24 PM  

I have also tested this by changing the Question Event to Show rather than hide.  I get the same results.  First time does not trigger the Show, second time does.

Is there an order to what event happens first, next, next during the post back?

Candace
Posts:1109
river guide
river guide

06/23/2009 2:38 PM  

Hi Dan,

I just responded to your other post then I came to this earlier one.  One thing to remember is that you will need to enable the payment gateway under Module Configuration to get PayPal to work so it will still try to get to PayPal even if you hide the payment method field.  This is the reason why we had to come up with a specific function with the PGateway (see Demo 18).

As an alternative, you might set it up with a Question event that sets question default based on another question's response.  Here's a quick sample I did for you.  Selecting Email 1 will set PGateway to PayPal; Email 2 will set it to Pay by Check.  You'll probably have to restructure the flow of  your form with client side events and hidden fields  to get this done.  Let me know if you have additional questions.  Thanks!

Candace

Dan Stauffer
Posts:53
river guide
river guide

06/23/2009 7:40 PM  

Thanks Candice,

Your betasprings example was helpful.  I have re-thought what I was doing and will be doing the following:

1. If amount > 1500; Set Default to Pay By Check

2. If amount > 1500; Disable PGateway (which has been set to Pay By Check - cannot Select PayPal)

I am still having the same problem that I noted.  The Question Event is not firing the first time the amount exceeds 1500 - It does on the second refresh where the amoint exceeds 1500.  It seems as if the Question Event and Client Side Script is firing out of order. The Question Event seems to be unaware of the Hidden Field update until the next post back.

Thanks for your help and any suggestions you might be able to offer.

Dan

Candace
Posts:1109
river guide
river guide

06/24/2009 9:21 AM  

Hi Dan,

Is the initiation question above the affected question on the form (has a lower sort order)? 

Otherwise, here's another thought.  How about you set the PGateway field to default to PayPal and then just have ONE question event that will change it to Pay by Check if amount > 1500. 

Candace

Dan Stauffer
Posts:53
river guide
river guide

06/24/2009 9:51 AM  

I did tinker with the sort order and I did notice that when my hidden field was above the affected field, the event did not work.  I think I have that setup properly.

 

I tried my earlier idea of disabling the PGateway - that did not work since the completion events did not trigger properly (It always defaulted to PayPal when disabled)

 

As for your current suggestion of defaulting to PayPal with a question event changing to PayByCheck.  I dont think this is an option since the form is dynamic (no pun intended) and the user is continuously making selections that change the amount based on what is selected.  (I can send you a link to the form so you get an idea of what it does - It is a private "Members Only" form but it is view all to get the IPN to work - so I don't want to post a link here).

 

How about this ... Always Hide PGateway and use question events and 2 other Fields to change its default.  One field would have Both Payment Options and would be visible for amounts < $1500 the other would have only PayByCheck and would be only be visible for amounts > $1500.

 

Do you think that might work?

 

Thanks, Dan

Candace
Posts:1109
river guide
river guide

07/02/2009 9:28 AM  
Hi Dan,

Sorry, your post somehow got missed or something. Were you able to get ths working?

Candace
You are not authorized to post a reply.
Forums > Product Discussion - DotNetNuke Modules > Dynamic Forms > Strange Behavior - Client Side Script, Question Events



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