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!

Client Side Problem
Last Post 03-01-2011 03:37 PM by Scott. 4 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
ScottUser is Offline
skipping stones
skipping stones
Posts:8
Avatar

--
02-27-2011 01:52 PM
    I am trying to get some very simple client side functionality to work. On my form, I have a dropdown menu that contains specific quantities of product that can be selected, and depending on the value of that dropdown, a shipping read-only field should auto-populate. The client side code I've written for the quantity dropdown menu is this:

    $(txtShipping) = '$9.95';
    if ($(lstQuantity) == '0') $(txtShipping) = '';
    if ($(lstQuantity) == '2000') $(txtShipping) = '$19.90';

    By default, the shipping field is blank. If I select any quantity option, the shipping field populates to "$9.95" as expected, and if I select the default "Select a Quantity" option the shipping field resets to nothing, again as expected. The problem comes when I select "2000" from the quantity dropdown; the shipping field should read "$19.90" but it instead reads "$9.95". It's as if the third line of JavaScript code above simply isn't getting read.

    I've tried a variety of different approaches to the JavaScript, I've scoured the DataSprings Dynamic Forms forum (including the various demonstrations) and I just can't get this to work. Any suggestions?
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    02-28-2011 08:57 AM
    Hello Scott,

    Well first of all you don't want the txtShipping to be a string, but rather an integer so you can use this number for your calculations of the grand total.

    Instead of referencing the token $(txtShipping) when ever you need the value, I would suggest assigning this to a variable.

    Perhaps:

    var theShipping = $(txtShipping);

    Now the JavaScript statement you provided could look like this:
    -------------------------------------------------------------------------------
    var theShipping = $(txtShipping);
    var lstQuantity = $(lstQuantity);

    if(lstQuantity == '0')
    {
    theShipping = 0;
    }

    if (lstQuantity == '2000')
    {
    theShipping = 19.90;
    }

    -------------------------------------------------------------------------------

    If you have any questions please let us know.

    Thanks,

    Ryan
    ScottUser is Offline
    skipping stones
    skipping stones
    Posts:8
    Avatar

    --
    02-28-2011 06:22 PM
    Ryan,

    Thanks for the response. I did get the following code to work:

    var txtShipping = '9.95'
    var lstQuantity = $(lstQuantity);
    if(lstQuantity == '1139.90')
    {
    txtShipping = '19.90';
    }
    if(lstQuantity == '1629.85')
    {
    txtShipping = '29.85';
    }
    if(lstQuantity == '2489.75')
    {
    txtShipping = '49.75';
    }
    if(lstQuantity == '4639.50')
    {
    txtShipping = '99.50';
    }
    $(txtShipping) = txtShipping;
    $(txtTotal) = $(lstQuantity);
    $(txtDescription) = ' Sports Bands + $40 Art Setup Fee + $' + txtShipping + ' Shipping Fee';

    Note that because I know what the shipping and setup fees will be based on quantity, I've embedded the final total into the Quantity dropdown control. The only problem now is that when I try to set the text of my Quantity dropdown to a value, it seems to wreck the entire client side computation. In other words, if I add the following line of code to the top:

    var txtQuantity = $(lstQuantity_Text);

    So I can end the computation with the following text (to be passed to Pay Pal):

    $(txtDescription) = txtQuantity + ' Sports Bands + $40 Art Setup Fee + $' + txtShipping + ' Shipping Fee'

    Then the entire client side computation fails. It's as if there is something wrong with the fetching of the text element associated with the Quantity dropdown menu. Am I referring to it incorrectly or something?
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    03-01-2011 07:52 AM
    Hello Scott,

    Try including your JavaScript under the Module Configuration -> Custom JavaScript File - > Initial JavaScript section.

    Your computations are getting lost during the post back of the question event.

    Please let me know if this helps you.

    Thanks,

    Ryan
    ScottUser is Offline
    skipping stones
    skipping stones
    Posts:8
    Avatar

    --
    03-01-2011 03:37 PM
    Ryan,

    I think you're right. Not only am I losing my text description of the purchase when the form posts to PayPal, but if I purposely leave some mandatory fields unfillled and click the submit button, I lose my client-side completed fields when the form posts back to itself. So, I tried copying the JavaScript into the Custom JavaScript File section as you suggested (Initial JavaScript field), but no joy--I still lose my data. I also tried the Submit / Save JavaScript field, but that didn't work either.

    I noticed with the pre-supplied JavaScript examples that the fields I'm trying to auto-populate (identified with a $) seem to require the text "DynamicForms_" in front of the variable. So, for example, I changed in my code:

    var lstQuantity = $(lstQuantity);

    to...

    var lstQuantity = $(DynamicForms_lstQuantity);

    However, that didn't work either. It seems like no matter what I try, I can't get the client side JavaScript to work correctly when the form posts. Am I still doing something wrong?
    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