value in textbox triggering question event?
Last Post 11-13-2012 07:54 AM by Chad Nash. 24 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
Sean SeanUser is Offline
going with the flow
going with the flow
Posts:54
Avatar

--
09-10-2008 11:36 AM

    Hi,

    I have a form with 10 questions and one hidden textbox

    I have enabled SQL as a default value for the hidden textbox, the value (from the querystring) is either 1 or 0 when the form loads. What I want is to show only the first 5 questions when the textbox value =0. And the second 5 questions when the textbox=1.

    The question events only fire after a postback. How can I cause it to get/read the value from the hidden textbox and show either the first 5 or the second 5 questions?

    thanks

    Jim EvansUser is Offline
    going with the flow
    going with the flow
    Posts:30
    Avatar

    --
    09-16-2008 06:53 AM
    Textboxes cannot be used to drive question events, at this time.

    Jim
    Sean SeanUser is Offline
    going with the flow
    going with the flow
    Posts:54
    Avatar

    --
    09-16-2008 07:51 AM

    thanks for answering Jim.

    It's not so much an issue about that textbox. To explain: There is this catalogue on the site with various products in different categories. When the customer clicks an item they are interested in they will be sent to the page with the dynamic form. Depending on the category item they have picked, they will see some questions in the form, whilst other questions remain hidden.

    Example: When their choice is to buy something from the clothing category, they need to answer the size and colour, so these questions in the form need to show.

    So the when the customer clicks an item in the catalogue, the ItemID and the CategoryID will be passed on to the url of the Dynamic Form page.

    How can I make the form show/hide questions depending on these 2 values from the querystring?

    I hope the question is clear

    Thanks again

     

     

    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    09-16-2008 11:54 AM
    Sean,

    Hi. Ill have to review if the question events can be triggered based on a hidden field as well. I know it would have to be a hidden field type and not a textbox that was selected as 'hide by role' etc... If it CAN then you should be ok. If you are using SQL within the SQL default AND a querystring variable you will have to use one of the reserved querystring / short field names which are DSParam1, DSParam2, and DSParam3. For more details on these I would search the forums directly for DSParam1 etc... If you still cannot get a working solution please setup a demo that illustrates what you are wanting on Beta Springs (login as username host with a password of dnnhost) and we will review it to determine how it can be done and if it can't what we might want to do as a work around or future enhancement etc...

    -Chad
    Sean SeanUser is Offline
    going with the flow
    going with the flow
    Posts:54
    Avatar

    --
    09-16-2008 01:38 PM

    Hi Chad,

    I've set up a Demo on beta springs

    http://www.betasprings.com/Valuefro...fault.aspx

    Obviously this demo doesn't work because it needs the table with Catalogue items in the database. I got the DSParam1 working on my local DNN site though.

     

    Where I get stuck is at the Question Events setup.  The question that will initiate the event of hiding or showing following questions basically does not exist. The trigger should already happen at Page Load where it can read the value ('answer') from the querystring ('DSParam2')

    Thanks

    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    09-16-2008 02:10 PM
    Sean,


    Hi. I am actually surprised this has not come up before as this would be heavily used in many implementations (that I can think of). Basically though during design the 'reason' users would use a question event would never involve a 'hidden' field type being a postback field.


    Anyway... I have updated the BetaSprings.com site to allow for hidden fields to be postback fields. So...I also changed the CatID variable to be a hidden field. Can you let me know (now that you can create a question event on this being the postback question) if this fields you up? If so this feature should be in the 2.7.1 incremental build that we will release soon. If not we will have to review testing it more to determine what will need to be added/changed within the code to allow this.


    -Chad
    Sean SeanUser is Offline
    going with the flow
    going with the flow
    Posts:54
    Avatar

    --
    09-16-2008 11:20 PM

    Hi Chad,

    Getting there ... The hidden field CatId shows, but it needs the 'initiation response' to be activated too to make it work.

    Looking forward to the 2.7.1 release

     

    thanks for your work

    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    09-30-2008 01:10 PM
    Ok, we are awaiting some more testing but this has been implemented now (at least as far as the question event is concerned with setting it up in the manage questions and settings area). So, please test it again on Beta Springs and let me know. We have a few other minor updates and will include this in the next incremental patch.

    -Chad
    Jim EvansUser is Offline
    going with the flow
    going with the flow
    Posts:30
    Avatar

    --
    09-30-2008 02:09 PM

    Chad,

    Any idea yet, when the 2.7.1 patch will be available?

    Jim

    Sean SeanUser is Offline
    going with the flow
    going with the flow
    Posts:54
    Avatar

    --
    09-30-2008 02:41 PM

    Hi Chad,

    Here's what I did:

    - Hidden textbox (CatId) with value 1

    - Question Event1 :  when CatId=1 then hide last question

    Now this only works when there is a postback. So for example I've set up a second Question event:

    - Question Event2: pick a color and some other question will be hidden.

    The moment this second question gets triggered by choosing a radiobutton-color ALSO the first question event gets triggered.

     

    Would it be possible to have this first event -with the hidden textbox -start to fire when the page loads? In the websites I'm building the value of this hidden textbox comes from the querystring. So it would be great when this first question event fires the very moment the form opens/page loads.

    Thanks

    Sean

    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    10-20-2008 07:36 AM
    Hi guys,

    Ok. I updated the installation file now on 2.7.4. We were really holding off on this small list of enhancements/patches until we were able to confirm that question events could fire based on hidden fields and initially on hidden fields. You should be able to test this now on Beta Springs, our internal tests worked for the main 'Unhide field' however we have not tested it for some of the other question events. We should have this released to everyone by the end of the week with a full announcement.

    -Chad
    schuhtlUser is Offline
    river guide
    river guide
    Posts:82
    Avatar

    --
    10-20-2008 11:52 AM

    Chad,

    Just to clarify...with this new feature can I hide/display questions based on a querystring parameter (when the page loads)? 

    Thanks,
    Troy

     

    schuhtlUser is Offline
    river guide
    river guide
    Posts:82
    Avatar

    --
    10-23-2008 10:21 AM
    Chad,
    Do you have an example on Beta Springs that I can play around with? I tried Sean's example and I don't think it is working anymore? I tried to create my own test form but it is not working either. Maybe it is just me not understanding your last post but Sean and I have both asked if this works with a querystring parameter and I am not sure you have answered the question or not? For example say you pass ?DSParam1=1 from another form. In my scenario, 1 is an event id. I would like to use the sql bind feature to lookup the event details (based on the DSParam1 value) and populate several hidden fields. These hidden fields would contain true or false information like....ShowAddress=True, ShowPhoneNumber=False, ShowPrice=True, etc.... When the page renders to the user I would like to dynamically show only the questions that have a related hidden field that is true. Does that make sense? Let's say I had a Address textbox that is hidden by default and a hidden question hAddress. If hAddress has a value of True then show the Address textbox otherwise keep Address hidden. So back to my initial question...is this possible and if it is, do you have an example on Beta Springs?

    Thanks,
    Troy
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    10-25-2008 02:27 PM

    Troy,

     

    Hi. Yes from what I understand of what you are wanting the new 2.7.4 release/patch/quick enhancements release should allow for this. We have been planning to release this over the past week and should by the end of the weekend (update downloads and update patches and hot fixes on Snowcovered).

     

    Anyway... I created a quick demo of this on Beta Springs. We are passing it the userID from DSParam1, we are using the SQL binding feature to pull in the user information, and if the Username is set to 'Admin' which is a hidden field on the form, then it will show the Address field. The Address field is initially hidden until forced visible by event.

     

    So for example, passing it the UserID of 1 doesn't show the address field, but passing the UserID of 2 does show the address field.

     

    Question Event w/ Hidden Field and Querystring - Hide Field

     

    Question Event w/ Hidden Field and Querystring - Unhide Field

     

    Is this what you are needing?

     

    -Chad

    schuhtlUser is Offline
    river guide
    river guide
    Posts:82
    Avatar

    --
    10-26-2008 07:15 AM
    Chad,

    Thanks for making the demo...this is exactly what I was looking for!

    Troy
    Matthieu LubacUser is Offline
    going with the flow
    going with the flow
    Posts:27
    Avatar

    --
    11-12-2008 01:35 AM

    Hi everybody,

    I actually need it to for one of my project.

    One question : Can we download this patch at this time or is it still in development ?

    DevPCI Team.

    schuhtlUser is Offline
    river guide
    river guide
    Posts:82
    Avatar

    --
    11-12-2008 01:51 AM

    It is available now...details.

    schuhtlUser is Offline
    river guide
    river guide
    Posts:82
    Avatar

    --
    12-22-2008 12:39 PM

    All,

    I am not sure if this is documented anywhere or not but I thought I would pass this info along to save you some time if you can't get this to work. Your Initial/Postback Question that you select in your Question Event (that displays or hides the question) HAS to be above (question sort order) the Affected Question you select in your Question Event.

    Example that works (based on Chad's demo above):
    question order...
    Email
    UserName
    Address

    Unhide Field - Question Event
    Initial/Postback Question: UserName
    Initiation Response: Address

    Example that does not work:
    question order...
    Email
    Address
    UserName

    Unhide Field - Question Event
    Initial/Postback Question: UserName
    Initiation Response: Address


    Troy

    J. RisseUser is Offline
    going with the flow
    going with the flow
    Posts:32
    Avatar

    --
    01-28-2009 05:05 AM

    Hi! That is a very interesting feature.

    I tried to use it as a language switch, but it only works if the name of the parameter is DSParam1 or DSParam2. If I tried to refer $(language) in the Initial SQL statement it does not work.

    Is it possible to use another name for the parameter DSParam1 or is that a fixed name?

    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    01-28-2009 12:54 PM
    Hi, there are a few custom parameters such as this when reference from querystring parameters and this is $(DSParam1), $(DSParam2) and $(DSParam3). Its actually $(DSSession1) thru 3 for session variables. This is because these are special tokens that get parsed through some SQL Injection routines for security purposes.

    -Chad
    Tim JohnstonUser is Offline
    wading in the water
    wading in the water
    Posts:16
    Avatar

    --
    03-10-2009 06:52 PM
    Will question events ever be triggered by the regular "Retrieve values from querystring variable for this question" option? That's the most obvious behavior a regular user would be expecting...

    TJ
    J. RisseUser is Offline
    going with the flow
    going with the flow
    Posts:32
    Avatar

    --
    03-10-2009 09:43 PM

    Hi Tim, the events are NOT triggered by this option. This was my first test.
    I created a form with a combobox. The combobox got question events to show/hide other fields. I tried the "retrieve from query string" option but nothing happened.

    But would be a really nice feature!

    moorecreativeUser is Offline
    wading in the water
    wading in the water
    Posts:18
    Avatar

    --
    11-12-2012 09:54 AM
    I think that the thread got off topic or side related topic from the original question.

    Can an event action be triggered by text in a textbox?

    I have selected "Set question default / return SQL response based on another questions response" but the list of dropdown options for questions that can be used for the "Initiation / Postback Question" are still only checkboxes or dropdown lists, etc. It does not seem like two useful ones, either Submit Button or importantly for this topic, textbox value entered.

    I tried just selecting the "Execute event for any response" check box to see if that would allow it to trigger off of every/any field entered, but it doesn't.

    is triggering an event based on completed textbox still not a feature of Dynamic Forms today?
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    11-13-2012 05:25 AM
    Hello,

    The answer is yes, however this requires an advanced approach.

    To get started:
    Please create a dummy Question Event and assign it to fire based on a question on your form. After saving this, inspect the field that you assigned the Question Event to. You'll see the JavaScript to fire a Question Event inside of the Question "onChange" attribute. Copy the JavaScript code.

    Go back into the Question event and set it to a field like a hidden field. That way nothing will really ever invoke it to fire. Then paste the JavaScript code you collected into the Textbox you want the Question Event to fire on.

    Please let me know if that makes sense.

    Thanks,

    Ryan




    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    11-13-2012 07:54 AM
    Just a quick followup... I think that the approach / suggestion and work around that Ryan mentioned should technically work however, in general firing question events from a textbox is not a feature that Dynamic Forms currently supports. We have enabled this in the past and it caused some problems and did not work as you would expect it to so we had to disable the ability to fire off question events from textbox fields.

    Thanks,

    Chad


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