Great Ideas. Always Flowing.

We are not happy until you are happy. Client satisfaction guaranteed. Whatever your needs and requirements, we have the skills and resources for the job!

Quick login...


Or... now make it easy with Facebook Integration
Connect via Facebook



Top Sellers

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

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 or record live videos from your webcam.

Build high performance, completely customizable data-entry forms and views driven by your DNN and external databases. New built-in tools make it a snap to quickly create data entry forms, data views, and even database tables. Plus, add your own HTML, CSS, Javascript, SQL commands, stored procedures,

The most advanced DotNetNuke shopping cart on the planet. Easy to use e-Commerce, Secure Shopping Cart Software and SEO friendly. B2C / B2B Ecommerce Sites.

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

Strange Behavior - Client Side Script, Question Events
Last Post 07-02-2009 07:28 AM by Candace. 6 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Dan StaufferUser is Offline
going with the flow
going with the flow
Posts:68
Avatar

--
06-23-2009 09: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 StaufferUser is Offline
    going with the flow
    going with the flow
    Posts:68
    Avatar

    --
    06-23-2009 10:24 AM

    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?

    CandaceUser is Offline
    river guide
    river guide
    Posts:2431
    Avatar

    --
    06-23-2009 12: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 StaufferUser is Offline
    going with the flow
    going with the flow
    Posts:68
    Avatar

    --
    06-23-2009 05: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

    CandaceUser is Offline
    river guide
    river guide
    Posts:2431
    Avatar

    --
    06-24-2009 07: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 StaufferUser is Offline
    going with the flow
    going with the flow
    Posts:68
    Avatar

    --
    06-24-2009 07: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

    CandaceUser is Offline
    river guide
    river guide
    Posts:2431
    Avatar

    --
    07-02-2009 07: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.


     
     

    Join our mailing list...

    Get current news and events the easy way
    Subscribe Me

    Recent Blogs...

     
    Copyright 2005 - 2011 by Data Springs, Inc.
     
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi