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!

Trigger question events on pageload?
Last Post 07-20-2010 09:51 AM by Ryan Bakerink. 17 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Jeff ClaytonUser is Offline
wading in the water
wading in the water
Posts:27
Avatar

--
04-11-2009 07:02 AM

    I have a form where the visibility of 'Field A' is controlled by a question event and the form is also setup for editing records using 'Initial SQL Rendering/Bind' feature where I pass in parameters as shown in DEMO #14 to update previous entries.

    How can I get the question events to fire on the initial page load when EDITING a record so that the visibility of 'Field A' matches the information being pulled from the database?

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

    --
    04-14-2009 07:46 AM
    Hi Jeff, several questions. Is "Field A" initially hidden on page load? What is the field type / value on the question event that is going to unhide "Field A"? In order to get the question event to fire on page load, you may need to base it on a hidden field value that get's it's value from the database on page load. -- David
    Jeff ClaytonUser is Offline
    wading in the water
    wading in the water
    Posts:27
    Avatar

    --
    04-14-2009 11:12 AM

    David, thanks for the reply. I'll give my real-world example...

    I have 3 dynamic questions setup that are checkbox lists and are all hidden until a category dropdown earlier in the form is used to determine which 1 of the 3 checkbox lists should be shown.

    There are three question events setup that each look at the category dropdowns value and depending on the value, the proper checkbox list will be displayed. So the question events simply toggle the display of checkbox lists.

    When filling out the form the first time, its not an issue. The question event fires after the category drop changes and then displays the proper checkbox lists. Then the user makes selections in that checkbox lists and saves it.

    If the record is brought up for editing (using the methodology described in demo #14), the category dropdwon has the original value that the user selected, but the question event which would normally fire after selecting a category does not seem to be triggered because the value is being pulled from the database and not causing the dropdown's 'On Change' event or whatever it is that typically fires question events.

    However, if I pull up a record for editing and go to the category dropdown and momentarily change the value to something else and then back to the value it originally pulled from the database...only then are the appropriate checkboxes displayed. The checkbox lists even have the correct values the user originally selected when submitting the form, I just can't get them to show without having to first re-toggle the category dropdown.

    So what I was HOPING is that somewhere in the Custom Javascript section I could enter some magical code that will cause all question events or even a particular question event to fire when the page loads so that all of the fields whose visibility is typically toggled during the initial submission of the form can be set to their appropriate states. Maybe fake a 'On Change' for the dropdown or something?

    You mentioned using a hidden field to get the value from the db. I can do that but would need to create some workarounds because I would then need to retrieve the same value twice when editing...once to populate the hidden field and another to populate the user's category selection in the dropdown even though the two will always be the same value because they are coming from the same db field.

    Is it that only question events based on hidden fields are fired on page load or that any field but a dropdown triggers associated question events on pageload. If its a matter of the values needing to be in hidden fields which the events are connected to, I understand what I need to do to fix things up but don't want to restructure the whole thing to find out events won't fire for hidden fields in my particular example. So if this is just the way it is, I get it, I'm just keeping my fingers crossed that I can somehow force these events to happen without tweaking the dataset and adding more (hidden) form fields.

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

    --
    04-14-2009 11:29 AM
    Question events can be based on a "hidden field". You can use client side javascript to set your "hidden field" to a chosen value from the down down list. Another words, if your shortname field of the combobox is "dropdown" which you get from the SQL binding on update, you can include this in the client side and initial javascript on load:

    $(hiddenfield) = $(dropdown)

    For your question events, make them act on $(hiddenfield) as opposed to the $(dropdown) field.
    See if this works or not. -- David
    J. RisseUser is Offline
    going with the flow
    going with the flow
    Posts:32
    Avatar

    --
    04-16-2009 09:34 PM
    Hi David,
    Hi Jeff,

    I had the same problem and tried to find a workaround for days (some weeks ago).
    I also had the idea to use a hidden field to fire the event like David mentioned above. Unfortunately it doesn't fire the event.

    The first part of the idea works fine ... the hidden field has the same value as the drop down list every time (no matter what you do). In fact, you can also get the value of the drop down list from the query string, cookie, session or from hell if you want ;-) ... but the question event will not fire.

    The only way I found to fire the event is to submit the form using:
    theForm.submit()
    ... But it's not a nice way and may stores the form (or sends an email).

    IMHO the best way would be, to call the normal postback for the dropdown using javascript. But you have to know the real (cryptical) name of the field, which is given by dynamic forms ... you cannot use something like:
    __doPostBack($(dropdown),\'\')

    Greetings from Germany,
    J.
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    04-17-2009 09:43 AM
    Hi guys... This really should work now, we are using this for a number of implementations. Just make sure you are running on 2.7.53, it was added in one of the incremental builds for the 2.7 release. Also, this MUST be a 'Hidden' field type, not a 'hide by role' on another type of field. If you continue to have problems please setup a test page on Beta Springs and we will help you out.

    -Chad
    Jeff ClaytonUser is Offline
    wading in the water
    wading in the water
    Posts:27
    Avatar

    --
    04-17-2009 12:33 PM
    Thanks to you both for the tips. Chad, the note that David left regarding the initial javascript being (in my case)...

    $(HiddenBusinessType) = $(BusinessType)

    Am I being silly thinking that is exactly what needs to be in the initial javascript section? I really know nothing about javascript so if its supposed to be surrounded by 5 lines of other code, maybe someone can help me out. If its supposed to be just that one line, then my quick attempt at adding a hidden field, entering that syntax into the initial javascript section and changing the question event to look at my new hidden field did not work. So maybe it is my version. When you say 2.7.53, how can I tell if I have that? In the install new modules section of my site it says 2.70.5, I purchased it from snowcovered back on Feb 14 2009 and the one patch that is in my snowcovered patches is from 2008 (prior to my purchase, which seems weird) but I probably did not install that. Can you tell me if the 12-7-2008 patch released in snowcovered is 2.7.53?

    If that is not the correct download I need, where can I get that .53 version?

    This issue is not causing me to lose sleep but I would like to get it to work if possible.
    Thanks - Jeff
    CandaceUser is Offline
    river guide
    river guide
    Posts:2431
    Avatar

    --
    04-17-2009 03:00 PM

    Hi Jeff.  Not sure why the patch date(s) in snowcovered is incorrect but it may just need updating.  Meanwhile, please send me a note referencing this thread and your order # and I'll send you the Dynamic Forms 2.7.53 file.  Thanks!

    Candace

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

    --
    04-19-2009 09:23 PM
    I purchased in Dec 2008 and got version 2.7.4.
    But now I at least know why it does not work.

    "Those who are late will be punished by life itself." (G. Gerassimow / M. Gorbatschow) ... but also if you are early ;-)

    Greetings from Germany
    - J.
    Jeff ClaytonUser is Offline
    wading in the water
    wading in the water
    Posts:27
    Avatar

    --
    06-30-2009 07:00 AM

    I wanted to follow up on this question I had from a long time ago, I’m finally getting around to implementing it. The new scenario is that I have a question event which fires when a check box is toggled. The event shows 4 additional textbox questions. Everything works fine during the initial form submission. However, when retrieving a record for edit, I retrieve an additional field from a Stored Proc to fill a hidden field with a value from a bit column in the db.

    I created a new question event to fire on the hidden field (I knew it could not be based on a non-hidden field based on the forum dialog above) which shows those same 4 fields when the value in the Stored Proc is True ( I also tried 1, -1 and Yes). I save the event and edit a record – none of the question event’s fields were shown. So then I chose for that question event to fire base on any value in the hidden field – still nothing.

    I’m definitely overlooking something here. I’m running DFv3 and DNN v4.09.04

    Any thoughts?

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

    --
    06-30-2009 08:54 AM
    HI, for debugging purposes, can you switch the hidden field to a regular textbox field and see if the store procedure is returning the correct value in the page load for when retrieving for edit? Then get back with me if it is or not and we can continue further. -- David
    Jeff ClaytonUser is Offline
    wading in the water
    wading in the water
    Posts:27
    Avatar

    --
    06-30-2009 09:00 AM
    I just changed it to a textbox, it's returning True (its a bit field in the db)
    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    06-30-2009 09:20 AM
    I'm not sure but perhaps it will only work for querystring variables. Can you change it back to a hidden field, but under "Advanced Field Options", set it to retrieve value from querystring variable, and in your URL, pass it the querystring name like this: ?shortname=true
    replace shortname with yours and see if this will trigger the question event. -- David
    Jeff ClaytonUser is Offline
    wading in the water
    wading in the water
    Posts:27
    Avatar

    --
    06-30-2009 10:12 AM
    I just tried what you mentioned, It still won’t fire the question event on page load for an EDIT. After making it a hidden field again and retrieving the value from the querystring, I changed it back to a textbox to verify the value is being retrieved correctly – it was.

    Any other thoughts?
    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    06-30-2009 12:57 PM
    HI Jeff, I sent you the XML file. All I did was deleted the two textbox fields that are supposed to unhide based on question event and recreated them and it works with the querystring now. I reckon it should work with the SQL query now as well. -- David
    Jeff ClaytonUser is Offline
    wading in the water
    wading in the water
    Posts:27
    Avatar

    --
    06-30-2009 01:30 PM

    David, good deal. I deleted and re-created things on my version and it worked as well. My live form has a lot more going on so rather than deleting and recreating things over there, I tried setting the sort order of the hidden field which triggers the question event t equal to 1 (the lowest on the form – figuring that would be the end result of recreating it) and that seemed to do the trick. It also worked when feeding a value directly to the hidden field from a stored procedure.

     

    Thanks for looking into it. It seems the sort order of a hidden field being used to control the visibility of other fields, must appear before the fields it’s controlling within the form’s sort order.

     

    Maybe that makes sense…as long as it’s working, I’m happy.

     

     - Jeff

    cassieUser is Offline
    skipping stones
    skipping stones
    Posts:7
    Avatar

    --
    07-19-2010 04:22 PM
    As a side note for everyone, I've tried to achieve something similar and got it working.

    Here are my notes:
    I've setup a form with a radio button called "Enquiry" triggering different question events depending on which enquiry option a user select.

    My goal is to trigger the target question event based on the query string parameter in the url, e.g. www.mysite.com/contact&Enquiry=General

    What I've done to get it working:
    1. Tick "Retrieve values from querystring variable for this question" for the radio button.
    1. A hidden field needed to be created with the SAME short field name as the radio button and tick "Retrieve values from querystring variable for this question" for this hidden field.
    2. For question events, replicate the question events on the radio button to hidden field instead of removing them. This way when user ended up selecting other options, the question events will still work.
    3. Most importantly, make the hidden field sort order as lowest, that is above all the other questions will be affected by the question events. Only this way will trigger the events on page load (thanks to Jeff Clayton).

    Hope this makes sense

    Cheers,
    Cassie
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    07-20-2010 09:51 AM
    Hello Cassie,

    We really appreciate when people like yourself take the time to help answer people's questions in forum threads. This helps us devote our time in different areas of development, support, and research.

    Thank you for taking your time to help others in the forums.

    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