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!

Using Short Name in SQL statement
Last Post 10-29-2007 02:14 AM by Sheldon Troyer. 3 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Sheldon TroyerUser is Offline
new to the springs
new to the springs
Posts:2
Avatar

--
10-25-2007 09:57 AM

    I'm setting up a simple contact form but would like to fill in default value for one question based on the value of another field.

    First off, I have added a required profile field labeled "CustomerID".  Then in my Dynamic Form I have added a question short name "DealerID" which I have set in "Advanced Field Options" to "DotNetNuke User Default" = "CustomerID".  The plan is that once the form is working correctly, this DealerID field will become a hidden field that the user doesn't see

    The field that I want to fill in using SQL is the short name "ServiceRepEmail" field.  Ideally, I would like this field to be a textbox, but I can only get the "Question Options" to come up if I use list box, radio buttons or combo box.  For now, I am just using the list box type so that I can experiment with the SQL options.

    On to the SQL statement.  I have a view set up in the DNN database called vDealers.  If I put in this SQL statement ...

    select Parts_Rep_Email as QuestionOption from vDealers where ID = '105'

    ... everything works fine.  It returns my single listing.  However, if I set the SQL statement to ...

    select Parts_Rep_Email as QuestionOption from vDealers where ID = $(DealerID)

    ... I get an error in SQL message.  So my questions are:

     

    1.  How do you reference a shortname form field within a SQL statement?

    2. Is there a way to use a SQL select statement to fill in the default value for a textbox?  Or is that only available with some of the other question types?

     

    Thanks,

    Sheldon

     

    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    10-28-2007 11:16 AM
    Is the $(DealierID) a textbox or a hidden field? If its a textbox there is a limitation to this because the SQL will not parse a textbox for the value. This is a security feature we implement because of possible SQL Injection (if someone entered something like (DELETE FORM USERS) instead of the dealer ID the query would look like:

    select Parts_Rep_Email as QuestionOption from vDealers where ID = ($(DealerID))

    Which really could screw you up...

    So first, is this a textbox field?

    -Chad
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    10-28-2007 11:20 AM

    Also,


    "2. Is there a way to use a SQL select statement to fill in the default value for a textbox?  Or is that only available with some of the other question types?"

     

    The answer to this question is not currently in v2.3 but you will be able to pull in a value from SQL in v2.5 (actually this has already been coded and will be available in the beta).  We are running a little behind on v2.5 (hoped to have it released by Nov 6th but it is are highest priority right now... You can see the full roadmap here.

     

    -Chad

    Sheldon TroyerUser is Offline
    new to the springs
    new to the springs
    Posts:2
    Avatar

    --
    10-29-2007 02:14 AM
    Thanks for the info Chad. The $(DealerID) is currently a textbox, with the intention of changing it to a hidden field after my initial testing. Absolutely makes sense that you have that that security measure in place to keep SQL injection from happening - I never gave that a thought. I will give that a try later today.

    Also, do you have an ETA for the beta of 2.5?

    Thanks!
    Sheldon
    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