SQL Validation Issue
Last Post 04-21-2011 01:10 PM by Ryan Bakerink. 5 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
cbtUser is Offline
wading in the water
wading in the water
Posts:26
Avatar

--
06-18-2010 06:29 AM

    I have a dynamic forms module where I need to use the SQL Validation functionality.  I discovered that if the user enters some data that contains a single quote, the module errors out on the validation.  Is there any way we can replace single quotes with double single quotes when running the validation? 

    cbtUser is Offline
    wading in the water
    wading in the water
    Posts:26
    Avatar

    --
    06-18-2010 07:56 AM
    If you want to see what I'm talking about, go to Demonstration No. 12 and enter a string with a single quote.
    JD ReadyUser is Offline
    new to the springs
    new to the springs
    Posts:2
    Avatar

    --
    04-21-2011 08:54 AM
    Discovered this today (alomst a year later) - YIKES! No answer!
    CandaceUser is Offline
    river guide
    river guide
    Posts:2431
    Avatar

    --
    04-21-2011 09:49 AM
    Hi JD,

    I see that Chad's speaking with you via email. Please continue the conversation in the email. Thanks!

    Candace
    JD ReadyUser is Offline
    new to the springs
    new to the springs
    Posts:2
    Avatar

    --
    04-21-2011 11:17 AM
    Ok, after reading Chad's email, the solution was:

    1) Add a new "hidden" question to the form: ValComments

    2) In the Comments question, add the following javascript:
    $(ValComments) = encodeURIComponent(escape($(Comments)))

    This code moves the SQL Safe / escaped text from the Comments field into the hidden ValComments field.

    3) In the SQL Validation, use the ValComments field instead of the Comments field:
    sp_EReviewValidation '$(Approval)', '$(ValComments)'

    This resolved my problem. However, it would be nice if:
    a) This solution were documented
    or better:
    b) The $(Comment) shortcut was automagically escaped

    Thanks!
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    04-21-2011 01:10 PM
    Hello JD Ready,

    Thanks for following up and letting us know that this is working for you now. Thank you for your opinions and suggestions that I think might be suitable for enhancement ideas.

    If you have any questions please let me know.

    Thanks,

    Ryan


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