Quick login...
 

 

DNN Modules
SnowCovered Top Sellers

Ultra Media Gallery is the most popular photo gallery and media gallery solution for DotNetNuke, UMG offers 10 different flash player to browse your gallery with completely different user interface experience.

Powerful, Ajax Enabled, Easy to Use. Document Management and Multimedia gallery functionality in one.Open-DocumentLibrary allows DotNetNuke users to organize share and manage documents, offering granular control over Folder and Document access.

Active Social is customizable social networking solution that fits the needs of a large company, small group, start-up business, or any size interest group. Connect with co-workers, people with similar interests, family, old friends, or meet new ones. Active Social provides a complete communication

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

In this day and age, knowing as much detailed information as possible about your customer, prospect or web site user is essential. Thankfully, the new 'Dynamics Forms' module from Data Springs, makes it easier than ever to segment your data collection efforts.

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 and play them in our integrated flash video player.

One stop solution for events calendar and events registration! FREE DOWNLOAD is available now!

The amazing ANY COLOUR Flex2 skin + our unique EasyMod module allowing you to customise just about everything in this skin. DrNuke just re-wrote the rule book again.

The Future of Enterprise Search for DotNetNuke 3.x and 4.xOpen-SearchEngine provides DotNetNuke with a true enterprise search engine capable of indexing html content as well as documents from multiple sites and/or physical directories.

Capture your users attention, enrich your site with multimedia flash, and create and opt in distribution list for your DNN site. These are just a few of the many features the Data Springs Module Collection can provide you.

Recently Viewed...
DNN Modules
   
    |   Register   |   Tuesday, March 16, 2010   
Hi Everyone!

You'll notice that we implemented a small change where your first and last name are now displaying in the forums.  If you do not wish to display your last name, please update your user profile and add a display name.  You'll find this by clicking on your name at the top of the page (right next to the Logout link).  Thanks!

Data Springs Product Forums...
Subject: Trigger question events on pageload?
Prev Next
You are not authorized to post a reply.

Author Messages
Jeff Clayton
Posts:22
going with the flow
going with the flow

04/11/2009 9: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 To
Posts:2121
river guide
river guide

04/14/2009 9: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 Clayton
Posts:22
going with the flow
going with the flow

04/14/2009 1:12 PM  

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 To
Posts:2121
river guide
river guide

04/14/2009 1:29 PM  
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. Risse
Posts:33
paddling down the creek
paddling down the creek

04/16/2009 11: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 Nash
Posts:3345
river guide
river guide

04/17/2009 11: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 Clayton
Posts:22
going with the flow
going with the flow

04/17/2009 2: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
Candace
Posts:1107
river guide
river guide

04/17/2009 5: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. Risse
Posts:33
paddling down the creek
paddling down the creek

04/19/2009 11: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 Clayton
Posts:22
going with the flow
going with the flow

06/30/2009 9: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 To
Posts:2121
river guide
river guide

06/30/2009 10: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 Clayton
Posts:22
going with the flow
going with the flow

06/30/2009 11:00 AM  
I just changed it to a textbox, it's returning True (its a bit field in the db)
David To
Posts:2121
river guide
river guide

06/30/2009 11: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 Clayton
Posts:22
going with the flow
going with the flow

06/30/2009 12:12 PM  
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 To
Posts:2121
river guide
river guide

06/30/2009 2: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 Clayton
Posts:22
going with the flow
going with the flow

06/30/2009 3: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

You are not authorized to post a reply.
Forums > Product Discussion - DotNetNuke Modules > Dynamic Forms > Trigger question events on pageload?



ActiveForums 3.7
Copyright 2005 - 2010 by Data Springs, Inc.
Terms Of Use | Privacy Statement