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!

userID in Client side events
Last Post 02-06-2013 06:16 AM by Ryan Bakerink. 11 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
toblerUser is Offline
wading in the water
wading in the water
Posts:19
Avatar

--
01-29-2013 09:06 PM
    Hi,
    can I access the userid token in client side events in DF using $(userid)?
    It doesn't appear to working for me.

    Cheers

    Tony
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    01-30-2013 09:18 AM
    Have you tried using $(UserID)? Not all lower cased letters? Case Sensitivity is probably the issue.

    Let me know if that works.

    Thanks,

    Ryan
    toblerUser is Offline
    wading in the water
    wading in the water
    Posts:19
    Avatar

    --
    01-30-2013 08:38 PM
    Hi Ryan,
    unfortunately, it still isn't working as $(UserID) - perhaps its something else I'm doing wrong?

    I have specified the following client-side event to set a hidden field $(user) I have on the form:

    if ($(Event Name)!='')
    $(user) = 'http://MyProfile/tabid/61/userid/'
    + $(UserID) + '/default.aspx'

    However, when viewing the javascript for this in debug mode, you can see below that $(UserID) is not being interpreted:

    Client Side Event:if (document.getElementById('dnn_ctr453_DynamicForms_TBR_GUID13938acb-185c-436b-be43-456ce910864aEvent Name').value!='') document.getElementById('dnn_ctr453_DynamicForms_Responses_1cd199b6-ec69-48c7-863f-8075f28443b5user').value = 'http://MyProfile/tabid/61/userid/' + $(UserID) + '/default.aspx';

    And when debugging in firebug, I get the following error:

    ReferenceError: UserID is not defined

    I would greatly appreciate your help and advice on where I'm going wrong.

    Cheers

    Tony
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    01-31-2013 07:37 AM
    Hello Tony,

    Can you please let me know what DNN version you're on?? Make sure that you're on the latest version of Dynamic Forms(4.1.4).

    UserID is a token that should be available. Please try this work around:

    1.) Create a hidden field with the lowest sort order on the form.
    2.) Let's say the short field name is "UID".
    3.) Create a SQL Default value for this hidden field:

    Select '$(UserID)' As DefaultValue

    4.) Enable Debug mode and see if '$(UserID)' is rendering correctly.
    4a.) If the value isn't rendering correctly.. let me know.
    4b.) If the value is rendering correctly...

    Utilize $(UID) in your JavaScript rather than $(UserID)


    if (document.getElementById('dnn_ctr453_DynamicForms_TBR_GUID13938acb-185c-436b-be43-456ce910864aEvent Name').value!='') document.getElementById('dnn_ctr453_DynamicForms_Responses_1cd199b6-ec69-48c7-863f-8075f28443b5user').value = 'http://MyProfile/tabid/61/userid/' + $(UID) + '/default.aspx';


    Let me know how this goes.

    Thanks,

    Ryan
    toblerUser is Offline
    wading in the water
    wading in the water
    Posts:19
    Avatar

    --
    01-31-2013 10:52 AM
    Hi Ryan,
    thanks again for your help with this.
    For info, i am running on 07.00.00 (1586) version of DNN.

    The workaround worked!! - the hidden field UID with SQL default was rendered within the javascript as:

    Client Side Event:if (document.getElementById('dnn_ctr453_DynamicForms_TBR_GUID13938acb-185c-436b-be43-456ce910864aEvent Name').value!='') document.getElementById('dnn_ctr453_DynamicForms_Responses_1cd199b6-ec69-48c7-863f-8075f28443b5user').value = 'http://MyProfile/tabid/61/userid/' + document.getElementById('dnn_ctr453_DynamicForms_Responses_50c9b1a1-a276-4549-871a-46729a4ce29eUID').value + '/default.aspx';

    I am more than happy to progress based on this workaround, but would appreciate it if you could let me know if you can identify why $(UserID) doesn't work as you would expect it to.

    Thanks very much,

    Tony
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    01-31-2013 01:51 PM
    Hello Tony,

    Actually, I don't believe $(UserID) is recognized in JavaScript sections. Only when it comes to SQL sections, such as INitial SQL Binding, SQL Defaults, SQL Driven Options, etc..

    Let me know if you have any questions.

    Thanks,

    Ryan
    toblerUser is Offline
    wading in the water
    wading in the water
    Posts:19
    Avatar

    --
    01-31-2013 10:59 PM
    Thanks again Ryan - I think it might be the case for all the generic DNN tokens - I had the same challenge with $(PortalAlias) and have had to solve it the same way - which is totally fine by me.

    To help with my learning however, could you elaborate on how the SQL statement of Select '$(UserID)' as DefaultValue works - ie what actual SQL is this then running, over what table for example?

    Cheers

    Tony
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    02-04-2013 05:01 AM
    Basically,

    $(UserID) returns the UserID of the User Account currently logged in.

    If no one is logged into an account when using the Dynamic Form, $(UserID) will return -1. Otherwise,
    it will return the respective UserID.

    For instance, if I'm logged in as "John Doe", which is UserID =4 in the Users table, then:

    Select '$(UserID)' As DefaultValue

    is

    Select '4' As DefaultValue

    You can use this value to tie into the Users, UserRoles, UserProfiles, etc.. by using this ID. This really gives you the opportunity to personalize a form to each user.

    Please let me know if you have any questions.

    Thanks,

    Ryan
    toblerUser is Offline
    wading in the water
    wading in the water
    Posts:19
    Avatar

    --
    02-04-2013 10:48 PM
    Thanks Ryan, I understand.

    Is there a full list of available tokens that can be used this way documented anywhere, with the correct spelling? - I think this would be really useful, but can't find it in the user guide.

    Cheers

    Tony
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    02-05-2013 05:01 AM
    Hello Tony,

    Each token would be scattered throughout documentation and not really listed in a single section.

    You can create an Email Form Completion Event and you'll see all of the available tokens that you can use:

    $(TabID)
    $(PortalAlias)
    $(PortalName)
    $(IPAddress)
    $(ModuleID)
    $(CurrentLanguage)
    $(CurrentURL)
    etc......

    Please let me know if you have any questions.

    Thanks,

    Ryan
    toblerUser is Offline
    wading in the water
    wading in the water
    Posts:19
    Avatar

    --
    02-05-2013 05:45 AM
    Thanks Ryan, that's useful to know, much appreciated.

    Regards,

    Tony
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    02-06-2013 06:16 AM
    You're more than welcome.

    You can find information on some built in tokens on pages 51, 52 and 164:
    http://www.datasprings.com/userguid...rGuide.pdf

    Hope you find this useful.

    Have a great day!

    -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