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!

Passing values from ddl and date field
Last Post 11-26-2012 04:53 PM by Collin. 15 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
CollinUser is Offline
going with the flow
going with the flow
Posts:57
Avatar

--
10-22-2012 05:17 PM
    I followed demo 11 and was able to retrieve values to a ddl that when fired populates a list of customers, however I'd like to filter that same list further by utilizing an additional date field when the ddl event is fired.

    I thought maybe this might be a completion event and was referencing demo 32 setting the "Set question default / return SQL response based on another questions response", but I can't seem to pass any ddl or date values from form fields using the below:

    DDL short name is $(Product)
    Datefield short name is $(DateAttn)
    Initiation/Postback response: ddl
    Affected Question: Customers

    usp_GetCustomers '$(Product)', '$(DateAttn)'

    From selected ddl and date fields, how do I pass these values through a stored procedure when the the ddl event is triggered?
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    10-25-2012 02:50 PM
    Hi Collin - A couple of things here...

    I know we do this using the "Coupon Code" demo at http://www.datasprings.com/formdemos. The value is not pulled in from a date field, it is pulled in from a textbox field though.

    1. What specific version of Dynamic Forms are you running on? That feature changed slightly between the 4.0 release and the 4.1 release so you might want to first make sure you are on the 4.1 release.

    2. Can you tell me if the DateAttn field is an actual "Date" field, or a textbox field? You might need to make it a textbox field.

    Other then that you might also enable Debug Mode to see what specific query is getting processed.


    Thanks,

    Chad

    CollinUser is Offline
    going with the flow
    going with the flow
    Posts:57
    Avatar

    --
    11-03-2012 04:14 AM
    Chad,

    I'm running version 4.10.4.23731 on DNN 6.2.1. The DateAttn field is a text box populated by the popup calendar. The field question type is set as "Date".

    I've also tried to populate a Customer CheckBox Group with the following:

    Select Customer as QuestionOption, DNNUserID as QuestionOptionValue FROM vw_xxx
    WHERE ProductID = '$(Product)' AND CAST('$(DateAttn)' AS DATE) BETWEEN BeginDate and EndDate

    OR

    Select Customer as QuestionOption, DNNUserID as QuestionOptionValue FROM vw_xxx
    WHERE ProductID = '$(Product)' AND '$(DateAttn)' BETWEEN BeginDate and EndDate

    The debug mode shows the below. It doesn't look like the DateAttn value is being passed.

    SQL Debug (Parse SQL Text For Variables):
    SQL Debug (Parse SQL Text For Variables):Select ModelName as QuestionOption, ProductID as QuestionOptionValue from tbl_xxx Order by ModelName
    Error w/ SQL Debug (Parse SQL Text For Variables):Select Customer as QuestionOption, DNNUserID as QuestionOptionValue FROM vw_xxx WHERE ProductID = '$(Product)' AND CAST('$(DateAttn)' AS DATE) BETWEEN BeginDate and EndDate
    SQL Debug (Parse SQL Text For Variables):Select Customer as QuestionOption, DNNUserID as QuestionOptionValue FROM vw_xxx WHERE ProductID = '4' AND CAST('$(DateAttn)' AS DATE) BETWEEN BeginDate and EndDate

    CollinUser is Offline
    going with the flow
    going with the flow
    Posts:57
    Avatar

    --
    11-05-2012 12:57 AM
    I found the following when returning Customer CheckBox Group SQL driven options:

    usp_GetCustomers '9/4/2012', '$(Product)' - This returns a list

    usp_GetCustomers '$(DateAttn)', '$(Product)' - This does not return anything

    I know the '$(DateAttn)' field will return a value since I passed it to another textbox using a question event. I then tried passing the value for the new textbox to the proc above, but I still can't get any results.

    I'm lost on how to return results based on more than one parameter in a checkbox group.
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    11-05-2012 07:52 AM
    Hi. So the DAteAttn is a textbox field? Just curious because textbox fields work a little differently and depending on the version of Dynamic Forms you are running on with question events because of module security.

    Can you tell me a few things:

    1. If you hard code the $(Product) token but leave the $(DateAttn) token in place does it still work? In other words, is the problem really using multiple fields or specifically the field type of DAteAttn.

    2. If you test using DateAttn as a hidden field does it work? Maybe test using a default value and a hidden field? I know you mentioned it is a "Date" field type, what happens if this is a standard "Textbox" field type? If this works as a textbox field type you might consider the jQuery Date Picker route we have demonstrated in demo 28 at http://www.datasprings.com/formdemos.

    3. Is the sort order of the DateAttn field before the other field that is referencing it?


    Thanks!

    -Chad
    CollinUser is Offline
    going with the flow
    going with the flow
    Posts:57
    Avatar

    --
    11-05-2012 05:16 PM
    1. No, if I leave he $(DateAttn) in place, it does not work. But, I can pass the token to another field using a question event.

    2. I've never been able to get hidden fields to show their values, so I don't know if it works. I show "DateSaved - Value: ". I've been wondering if this is a bug.

    3. Yes, the sort order of the DateAttn field is before the other fields it's referencing.
    CollinUser is Offline
    going with the flow
    going with the flow
    Posts:57
    Avatar

    --
    11-05-2012 06:29 PM
    I created another form with the same results (variables are named differently):

    SQL Debug (Parse SQL Text For Variables):Select ProductID as QuestionOption, ProductID as QuestionOptionValue from tbl_xxx
    Error w/ SQL Debug (Parse SQL Text For Variables):usp_xxx '$(Date)', '2'
    SQL Debug (Parse SQL Text For Variables):usp_xxx '$(Date)', '2'
    Initial Javascript:

    The date param is strictly a text field. Hard coding the date param in the sproc yields results. It's not parsing the $(Date) param. Answer why it's not doing that, and we got it licked.
    CollinUser is Offline
    going with the flow
    going with the flow
    Posts:57
    Avatar

    --
    11-06-2012 04:27 PM
    Further testing shows that it doesn't matter what text field value I try to pass to a paramater, the parameter does not have a value:

    Error w/ SQL Debug (Parse SQL Text For Variables):Select Customer as QuestionOption, DNNUserID as QuestionOptionValue from vw_xxx Where ProductId = $(TV)
    SQL Debug (Parse SQL Text For Variables):Select Customer as QuestionOption, DNNUserID as QuestionOptionValue from vw_xxx Where ProductId = $(TV)

    Why?
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    11-07-2012 06:41 AM
    Hello Collin,
    Unfortunately the only way to embed a Dependent value from a Text box into a SQL Default Driven query is to invoke a Postback within Dynamic Forms.

    Now you're wondering how to do that since you've tried. Well, I'd start off by creating a Question Event on a Field like a Radio Button, Combo box, etc.. Make it fire for any response. Now after doing so and creating the Question event. Inspect the Question on your Form that you tied the Question Event to.

    You should see some embedded JavaScript in an OnClick or OnChange HTML Attribute. Copy the entire string of JavaScript in this event. Now you have at your fingertips, the ability to fire a question event(to use it for a postback)

    With this copied code, place this into the On Client side section of your TV Textbox. That way when losing focus of the textbox, the Question Event will be called and will fire. Add a Hidden Field to your form, just a place holder. Go back and modify your Question event and set it to fire on any response from the hidden field you just added.

    This is a workaround for Textboxes and dependent values.

    You'll also want to modify you SQL, as it will error out the first time you land on the page with the invocation of the question event:

    Select Customer as QuestionOption, DNNUserID as QuestionOptionValue from vw_xxx Where ProductId = '$(TV)'

    Just through '' marks around the Token.

    Let me know if you have any questions.

    Thanks,

    Ryan

    CollinUser is Offline
    going with the flow
    going with the flow
    Posts:57
    Avatar

    --
    11-07-2012 04:59 PM
    Ok, makes sense. I probably have some syntax wrong since I'm not a javascript guy, but I pasted in the date client side event as:

    onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("dnn$ctr511$DynamicForms$imgMove_8af428df-3b24-4863-b2a4-c65c97e257fc", "", true, "", "", false, false))"

    I get an error of:

    SQL Debug (Parse SQL Text For Variables):Select ProductID as QuestionOption, ProductID as QuestionOptionValue from tbl_xxx Order by ModelName
    Error w/ SQL Debug (Parse SQL Text For Variables):usp_xxx '$(txtDate)', '$(ddlProd)'
    SQL Debug (Parse SQL Text For Variables):usp_xxx '$(txtDate)', '2'
    Client Side Event:onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("dnn$ctr511$DynamicForms$imgMove_8af428df-3b24-4863-b2a4-c65c97e257fc", "", true, "", "", false, false))";
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    11-08-2012 06:25 AM
    Hello Collin,

    Paste only this into the Client Side section:
    ------------------------------------------------------------------------------------------
    WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("dnn$ctr511$DynamicForms$imgMove_8af428df-3b24-4863-b2a4-c65c97e257fc", "", true, "", "", false, false))";
    ------------------------------------------------------------------------------------------

    Let me know if this invokes the Question event after tabbing out of your Textbox.

    Thanks,

    Ryan
    CollinUser is Offline
    going with the flow
    going with the flow
    Posts:57
    Avatar

    --
    11-08-2012 07:03 AM
    Applied the code, but no change.

    Where you said "Add a Hidden Field to your form, just a place holder. Go back and modify your Question event and set it to fire on any response from the hidden field you just added," I created the hidden field and modified the ddlProd question event by making the hidden filed the postback, setting execute event for any response. Initiation response=DSDYNAMIC. Is that correct?
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    11-08-2012 10:47 AM
    Hello Collin,

    Did you apply this code to the Textbox that you're wishing to use as a reference to your Combo box?

    Is there a postback occurring? Is there no postback?? The first feat, is to instantiate the postback. Once you have this working everything else will fall into place.

    Thanks,

    Ryan
    Roel BroersmaUser is Offline
    wading in the water
    wading in the water
    Posts:24
    Avatar

    --
    11-23-2012 10:54 AM
    Did you ever solved this?
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    11-26-2012 05:37 AM
    Hello Roel,

    Waiting to hear from Collin, but I've been able to achieve this behavior with DF 4.1.4 and DNN 6.1.5 and DF 4.1.4 and DNN 6.2

    -Ryan
    CollinUser is Offline
    going with the flow
    going with the flow
    Posts:57
    Avatar

    --
    11-26-2012 04:53 PM
    Sorry for the delay--holidays. I did apply the code the date textbox and it looks like I'm getting a postback, but still the date textbox value is not being returned as evidenced in the debug mode.
    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