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!

Java 'null' error from hidden questions
Last Post 02-18-2010 11:36 AM by David To. 3 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
THSUser is Offline
going with the flow
going with the flow
Posts:48
Avatar

--
02-17-2010 09:03 PM

    I have a form that successfully totals options from radio button questions (it's an event registration form) and processes through PayPal with no problems. However, when questions are setup as hidden that are made visible from a question event (for example, the registrant first selects whether they're a member or not which then displays the questions and pricing for members and vice versa for non-members to get non-member questions and pricing), I'm getting js errors like this:


    Message: 'null' is null or not an object
    Line: 65
    Char: 1
    Code: 0
    URI: https://www.../Portals/0/Dynamic-Forms_Module_455.js

    My assumption is this is due to questions that remain hidden which are 'null' which of course keeps the form from doing the totaling. The script that's doing the totaling is as follows:


    $(TotalMemTrack) = funcRadioCalc($(MemTrack_FieldID))
    $(TotalLunchMem) = funcRadioCalc($(LunchMem_FieldID))
    $(TotalLunchNonMem) = funcRadioCalc($(LunchNonMem_FieldID))

    $(GrandTotalHidden) = parseFloat($(TotalLunchMem)) + parseFloat($(TotalMemTrack)) + parseFloat($(TotalLunchNonMem))

    $(Amount) = formatCurrency($(GrandTotalHidden))

    $(PayPalTotal) = toTwoDecimals($(GrandTotalHidden))

     

    So, my thought was to setup If/Else statements in place of the code that's just pulling what's being sent by the question so a zero is plugged into the script that does the totaling instead of a null - like this:

     

    if (funcRadioCalc($(LunchMem_FieldID)) == null) {
    $(TotalLunchMem) = 0;
    } else {
    $(TotalLunchMem) = funcRadioCalc($(LunchMem_FieldID));
    }

     

    However, I'm still getting the 'null' error. Another thought was I needed to expand the If part a bit more to include a zero length being sent by the hidden question like this:

     

    if (funcRadioCalc($(MemTrack_FieldID)).length==0)||(funcRadioCalc($(MemTrack_FieldID))==null) {
    $(TotalMemTrack) = 0;
    } else {
    $(TotalMemTrack) = funcRadioCalc($(MemTrack_FieldID));
    }

     

    But, I don't know if this is the correct syntax or what. Am I on the right track or is there another way to ignore the nulls from the hidden questions?

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    02-18-2010 07:06 AM
    HI, any fields that you set "hidden until made visible by a question event" or "Hide from roles" will not be rendered on the page, so client side javascript will not know it exists and also that field will not be saved to the database unless, of course, it gets triggered visible first and then client side javascript can then act on it.

    So your if else statement:
    if (funcRadioCalc($(LunchMem_FieldID)) == null) {
    $(TotalLunchMem) = 0;
    } else {
    $(TotalLunchMem) = funcRadioCalc($(LunchMem_FieldID));
    }
    will error out since the field "LunchMem" is still hidden on page load. What you want to do is set $(TotalLunchMem) = 0 on page load under Module Configuration / Initial Javascript. Don't reference any radio button fields yet on page load. Then proceed with your javascript that you had on the radio button fields. I think this will work out for you. -- David
    THSUser is Offline
    going with the flow
    going with the flow
    Posts:48
    Avatar

    --
    02-18-2010 11:22 AM

    Hi David -

    OK, that makes sense. So, what is the syntax for setting something to zero on page load?

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    02-18-2010 11:36 AM
    $(TotalLunchMem) = 0;

    in module configuration / javascript / initial javascript

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