s
Contact Login Register
h M

IE 10 & Dynamic Form Submit Button issues

I’ve seen several cases of this in IE 10. I found that when the Dynamic Form’s submit button is rendered by IE 10, the OnClick event has: “JavaScript:;” inside of the onClick event. It seems that IE 10 does not like this and instead disables the button from executing as it should.

To alleviate the inconsistencies between browsers, I create a custom submit button. It’s also a plus to have a custom submit button, because you can:

1.) Have the ability to fully customize the submit button

2.) Have the ability to control the submit button layout/placement.

 

To learn how to create a custom submit button in Dynamic Forms, please review the following blog:

http://www.datasprings.com/news/blog/postid/53/custom-dynamicforms-submit-button

 

This is a quick tip that should help conform your Submit button for most Internet Browsers.

Thursday, April 25, 2013/Author: Chad Nash/Number of views (273887)/Comments (-)/ Article rating: 3.0
Categories: In The Flow

JavaScript Function to replace ' and " with Single Quote or Double Quotes

We all know that collecting information from users can be potentially dangerous. Not because the user means to be malicious, but because you may not have a procedure/function in place to handle single quotes or double quotes. This can cause issues when the data is passed to the database. In most cases a SQL Stored Procedure can handle “SQL Injection” with single quotes and double quotes. However with Dynamic Forms or Dynamic Registration tokens should be encapsulated inside of '$(Token)'. So if you’re passing a Token into a stored procedure call:

exec MyProcedure '$(Token)'

You can see how collecting a ' in a textbox and passing to a stored procedure or inserting directly into a database table can become an issue. For instance, let’s say that the value I provided for a textbox in Dynamic Forms was:

FireShot Screen Capture #063 - 'Dynamic Registration' - dnn7_betasprings_com_ModuleTesting_DynamicRegistration_tabid_91_Default_aspx

 

When using the $(FirstName) token from this form in a SQL Completion Event the value would render as:

'John O'Neal'

You can see how handling this on the client side instead of Server side can be beneficial within Dynamic Forms or Dynamic Registration.

 

Add this JavaScript function to your Dynamic Form or Dynamic Registration Custom JavaScript file:

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

function Replace_Single_Double_Quotes(DF_QuestionID)
{
    //Assigning passed in parameter to variable
    var QuestionValue = document.getElementById(DF_QuestionID).value;
   
    //This field will assist us in knowing whether to replace " with a left or right double quote
    var NeedRightQuote = 'False';

    //Loop that checks each character in the QuestionValue variable
    for ( var i = 0; i < QuestionValue.length; i++ )
    {
        //Is this character a '?
        if(QuestionValue.charAt(i) == "'")
        {
            //Replace ' with an apostrophe
  &

Thursday, April 11, 2013/Author: Chad Nash/Number of views (307314)/Comments (-)/ Article rating: 4.0
Categories: In The Flow

SQL Driven Queries for Combo Boxes, Radio Buttons, Listboxes, and Checkbox Groups

Dynamic Forms & Dynamic Registration require that you return at least two columns for a SQL Driven questions: QuestionOption and QuestionOptionValue

QuestionOption = Text User will see

QuestionOptionValue = Value behind the Item that User will see

 

For Dynamic Views, you can have SQL Driven Combo Boxes and Radio Buttons for Search Filters. This requires that you return at least two columns named SearchOption and SearchOptionValue.

SearchOption = Text User will see

SearchOptionValue = Value behind the Item that User will see

This means that you can use the queries below in Dynamic Forms / Dynamic Registration or Dynamic Views by simply changing the alias of the columns being returned.

 

Example:

Query for Dynamic Forms / Dynamic Registration:

SELECT RoleName AS QuestionOption, RoleId AS QuestionOptionValue FROM Roles 

Query for Dynamic Views:

SELECT RoleName AS SearchOption, RoleId AS SearchOptionValue FROM Roles 

 

Below are queries that I use often:


1.) Get States
---------------------------------------------------------------------------------------------------

SELECT '-- Select State --' AS QuestionOption, '-1' AS QuestionOptionValue, '0' AS SortOrder
UNION ALL
SELECT Text AS QuestionOption, Value AS QuestionOptionValue, Text AS SortOrder
FROM Lists
WHERE ListName = 'Region' AND ParentID = 221
ORDER BY SortOrder

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

2.) Get States and Territories:
---------------------------------------------------------------------------------------------------

SELECT '-- Select State --' AS QuestionOption, '-1' AS QuestionOptionValue, '0' AS SortOrder
UNION ALL
SELECT Text AS QuestionOption, Value AS QuestionOptionValue, Text AS SortOrder
FROM Lists
WHERE ListName = 'Region'
ORDER BY SortOrder

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

 

3.) Get Countries with United States at the top:

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

SELECT '-- Select Country --' AS QuestionOption, '-1' AS QuestionOptionValue
UNION ALL
SELECT Text AS QuestionOption, Value AS QuestionOptionValue
FROM Lists
WHERE ListName = 'Country' AND Text = 'United States'
UNION ALL
SELECT Text AS QuestionOption, Value AS QuestionOptionValue
FROM Lists
WHERE Lis

Monday, March 25, 2013/Author: Chad Nash/Number of views (297256)/Comments (-)/ Article rating: No rating
Categories: In The Flow

Integrating Dynamic Forms and the jQuery Tooltip Widget

Dynamic Forms has a feature named “Help Icons” which work as Tooltips for your Questions. By Default this feature is disabled, so to enable you’ll need to go to Module Configuration –> General Settings and Uncheck the checkbox “Hide Help Icons”. Below is an image of how this feature operates.

FireShot Screen Capture #046 - 'GoToTraining Page 1' - www_datasprings_com_gototraining-page-1

However I always enjoy pursuing alternate methods to achieve a more efficient and dynamic solution. This example will be showcasing the jQuery UI Tooltip Widget. I will be integrating Dynamic Forms and the jQuery Tooltip Widget in this example. Below is an image of the Dynamic Form we’ll be using for this example.

FireShot Screen Capture #042 - 'GoToTraining Page 1' - www_datasprings_com_gototraining-page-1

To implement this behavior, I’ll show you how to do this in 3 simple steps:

Step 1:                

Accumulate all of the HTML Id’s of the controls that you wish to have the Tooltips.

For instance, I have Inspected the First Name, Last Name and Email Address Textboxes using FireBug in Firefox and located the following ID’s in my Dynamic Form:

First Name HTML ID = dnn_ctr2640_DynamicForms_TBR_GUIDf329fd1d-a30c-4cd9-b7ce-44fd1c54518aFName

Last Name HTML ID = dnn_ctr2640_DynamicForms_TBR_GUID7169778c-218e-4345-be2c-d98f224fe7cfLName

Email Address HTML ID = dnn_ctr2640_DynamicForms_TBR_GUIDf91097e8-4251-49b8-ad31-c93905ad6101EmailAddress

** NOTE: Your Dynamic Forms Question HTML ID’s will be completely different than the one’s in this example. Copy/Paste won’t work for Step 1.

Monday, November 26, 2012/Author: Chad Nash/Number of views (235891)/Comments (-)/ Article rating: No rating
Categories: In The Flow
Tags:

T-SQL Script Generator BETA

Hello Everyone,

I have just opened our SQL Scripting website to the public. Over the past month I have been piecing this website together. I am now confident and feel that we’re in a good place for user trialing.

Website Purpose:

The purpose of this website is to provide SQL Scripting tools to users with registered accounts. Currently there is a T-SQL Table Generator tool and a T-SQL Stored Procedure Generator tool.  With these tools a user will

  1. Interact by inputting information into the Generators.
  2. Retrieve an output of T-SQL based on your inputted information.
  3. All Generated Scripts are saved under “My Account”. 

***The overall goal is to assist users that may not understand the syntax and semantics of SQL.

Try the T-SQL Generating Tools:

Please login to http://scripts.datasprings.com using either of the two available accounts:
 
User #1
Username: TestAccount1
Password: 1234567
 
User #2
Username: TestAccount2
Password: 1234567

This is a BETA site that we'd like to dedicate more development to. Data Springs would like your opinion, can you see these tools being of assistance to you?

Future Improvements Include:

  • MySQL Mode for Creating Tables and Stored Procedures
  • PostgreSQL Mode for Creating Tables and Stored Procedures
  • Oracle Mode for Creating Tables and Stored Procedures
  • New tool for SQL Triggers, SQL Constraints, SQL Indexes, and SQL Functions.

 

Contribute to Data Springs by:

Providing feedback based on your experience with http://scripts.datasprings.com. You can provide feedback by leaving a comment to this blog post or by emailing us at dnnsupport@datasprings.com

Tuesday, November 20, 2012/Author: Chad Nash/Number of views (185912)/Comments (-)/ Article rating: No rating
Categories: In The Flow
Tags:
RSS
1234

Enter your email below AND grab your spot in our big giveaway!

The winner will receive the entire Data Springs Collection 7.0 - Designed to get your website up and running like a DNN superhero (spandex not included).

Subscribe