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!

Help adding textbox values and validating input.
Last Post 04-27-2010 07:59 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
Patrick MurrayUser is Offline
new to the springs
new to the springs
Posts:4
Avatar

--
05-12-2009 02:46 AM

    <!--[if gte mso 9]> Normal 0 unctuationKerning /> false false false ontGrowAutofit /> MicrosoftInternetExplorer4

    <!--[if gte mso 10]>

    <!--[if gte mso 9]> Normal 0 false false false MicrosoftInternetExplorer4 <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; font-size:12.0pt;"Times New Roman"; mso-fareast-"Times New Roman";} @page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt;} div.Section1 {page:Section1;} --> <!--[if gte mso 10]> As an absolute beginner to client side JavaScripting I need to add together the user entered values in six textboxes in Dynamic Forms. There are several examples on the site where the values are taken from dropdown combo boxes multiplied by number of units or similar, but I can’t figure out how to just add textbox values together.

    Another thing I need to do is validate the entries as integers and to really complicate things I need to ensure the total does not exceed a fixed amount.

    Is this something in JavaScript or would I need to use a regular expression?

    Any help would be much appreciated!

    Thanks

     

    Patrick

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

    --
    05-12-2009 06:25 AM
    HI Patrick, this can be done with javascript. Let's say you have two textbox with shortname box1 and box2. You can add them using the following javascript:
    $(total) = parseint($(box1)) + parseint($(box2))

    if $(total) > something {do this}
    else
    {do something else}

    -- David
    Patrick MurrayUser is Offline
    new to the springs
    new to the springs
    Posts:4
    Avatar

    --
    04-27-2010 07:36 AM

    Hi david,

    This has taken me a long time to revert on!

    Do I insert $(total) = parseint($(box1)) + parseint($(box2)) in the Client side event in the "total" textbox - have set this textbox as read only, but it dosent seem to work.

    Also the if $(total) > 1000000, how can I make the form present a message "this amount exceeds the maximum allowd" and hide the submit button, and the "else" action show no message and keep the submit button unhidden.

    If this is a custom development let me know and I'll submit it accordingly.

    Regards

     

    Patrick

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

    --
    04-27-2010 07:59 AM
    Okay, there are several ways to do this. You can use client side javascript or SQL validation. But since your logic says that if $(total) > 1000000, and forces the user to not be able to submit, I will go with the SQL validation route.

    1) to error trap for integers entered into the textbox fields, you will need to use REGEX validation on the textbox field (see this website url):

    http://www.regexlib.com/DisplayPatt...tegoryId=3

    2) under module configuration / validation, you can set SQL Validation. What you do is create a stored procedure and calling that stored procedure passing in the textbox fields and returning IsValid = 1 for allowing user to submit the form and IsValid = 0 for not allowing user to submit the form.

    create procedure usp_checktotal (@box1 int, @box2 int)
    as
    begin
    declare @Total int;
    set @Total = @box1 + @box2
    if @Total < 100000
    select 1 as IsValid
    else
    select 0 as IsValid
    end

    Call this stored procedure in your SQL Validation area:

    usp_checktotal '$(box1)','$(box2)'

    Also, make sure to provide the SQL Validation error.

    You could also use client side javascript and have an alert message to say that the amount exceeds and hide the submit button and if it doesn't exceed to unhide the submit button. Whichever route you choose is up to you. We could also provide custom development (http://www.datasprings.com/Premium-Support) but it will have to be 6 hours purchase. -- 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