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!

SQL Driven Textbox
Last Post 12-30-2010 10:51 AM by Ryan Bakerink. 6 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Skip M.User is Offline
skipping stones
skipping stones
Posts:9
Avatar

--
04-28-2010 12:21 PM

    My site has a registration form for several different seminars and uses the Dynamic Registration module to do so.

     

    On the home page, there are several different seminars to choose from. Selecting one will put the code for the seminar into a querystring and pass it along to the next page (which is the registration page). There is a DropDownList [called "SeminarCode"] that is populated by an SQL table, reads the QueryString and selects the correct Seminar as follows:

     

    SELECT Seminar as QuestionOption, SeminarCode as QuestionOptionValue FROM vw_seminar

     

    This works fine.

     

    Further down the form, I have a textbox that displays the cost of attending the selected seminar by pulling the cost out of the SQL table. However, it only works if I hard code the seminar code in; With:

     

    SELECT Cost AS DefaultValue FROM vw_seminar WHERE SeminarCode = 'SEM0208'

     

    or with my stored procedure:

     

    EXECUTE sp_GetSeminarPrice 'SEM0208'

     

    I get $100. I tried the other seminars with this technique and got their respective cost displayed properly.

     

    But, if I try with $(SeminarCode), I get a blank textbox. I've checked and unchecked the "Pass values of this question to session variable" and "Retrieve values from session variable for this question" options any which way to no avail.

     

    Is there another way that I can try to get this information such that I can dynamically display the price of the seminars based on what the DropDownList is displaying? Any help would be great.

     

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

    --
    04-28-2010 12:51 PM
    HI, this cannot be done with a textbox. You would need to change that textbox to a drop down box instead. Check out our dependent drop down combobox tutorial here:

    http://www.datasprings.com/Products...fault.aspx

    -- David
    Skip M.User is Offline
    skipping stones
    skipping stones
    Posts:9
    Avatar

    --
    04-29-2010 12:14 PM

    Here's the deal.

     

    Our registration form has a drop down as the first question. The price that the user pays for the registration depends on which item they pick from the drop down list. Each item in the list has a different price. How can we make that happen?

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

    --
    04-29-2010 12:35 PM
    Well, that's why I was suggesting you use dependent drop down list instead.
    1) your first combobox (let's say shortname: combobox1) would be:
    SELECT Seminar as QuestionOption, SeminarCode as QuestionOptionValue FROM vw_seminar
    2) create a second combobox; under advance field options, make it hidden until displayed by question event. The SQL driven statement would be:
    SELECT Cost as QuestionOption, Cost as QuestionOptionValue FROM vw_seminar WHERE SeminarCode = '$(combobox1)'
    3) go to question events, create a question event to trigger for any reponse on the question "combobox1" and have it display "combobox2" field

    This should work for your need. The only difference is that the textbox field is a combobox field instead, and returning only one value which is the price. -- David
    DougUser is Offline
    wading in the water
    wading in the water
    Posts:15
    Avatar

    --
    12-15-2010 06:38 AM
    David,

    What about your above scenario, however in some cases you would not display the second combo box at all?

    For instance:

    a. I have a product table that drives my first combo box

    b. Some of the products have "sub products", some do not. I have a sub products table for the 2nd combo box to use, based on the 'ProductID' (QuestionOptionValue of DD1) of the first combo box.

    c. I have a flag in the product table named 'HasSubProd' for each product.

    d. I only want the 2nd (or in my case, the sub product) combo box to show up if there is indeed a sub product (if the HasSubProd flag is True).


    How can I implement the above??

    I've tried all kinds of scenarios and have been through the forums and can't the value of combo box 1 to be used as a SQL parameter in either my hidden field with a SQL driven default value, or in a question event setting a question default based on another question. If I hard code in the value I get the results, but obviously it must be dynamic.

    I appreciate the help.

    Doug
    DougUser is Offline
    wading in the water
    wading in the water
    Posts:15
    Avatar

    --
    12-15-2010 07:02 AM
    Got it working!

    Pretty strange setup but from all that I can tell it must be exact as below or it won't work.

    In addition to what I posted above as my setup:

    -HasSubProd as a hidden field with a SQL default value of "select HasSubProd as DefaultValue from Product where ProductID = $(ComboBox1)"

    -A question event that sets the question default for the same HasSubProd field. Product DD as postback question, any response, HasSubProd as affected, with SQL driven value same as in question: "select HasSubProd as DefaultValue from Product where ProductID = $(ComboBox1)"

    -A 2nd question event that displays hidden question. Postback question HasSubProd, response True, display 2nd combo box

    And then it works! Just weird that I would have to put the same SQL statement in two places. If I took it out of the hidden field, the sequence didn't work. The order of the hidden field didn't seem to matter.

    -Doug
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    12-30-2010 10:51 AM
    Hello Doug,

    I'm glad to hear you figured out how to get this to work for you.

    I'm sorry for the tardy response, sometimes forum threads get lost in the void of thousands of forums. I just came across this thread.

    If you have any questions please let us know.

    Thanks,

    Ryan
    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