Update DNN Core field PreferredLocale
Last Post 01-08-2013 10:10 AM by Ryan Bakerink. 4 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
Matthew CrowshawUser is Offline
wading in the water
wading in the water
Posts:20
Avatar

--
12-27-2012 12:25 PM
    Is it possible to update a DNN core field (in this case PreferredLocale) based on a JavaScript routine in DR?

    Should this script be placed in the client side event?

    Here's what I'm thinking (where PrefLang is the user selected radio button option):

    if($(PrefLang) != 'French')
    {
    $(PreferredLocale) = 'en-CA'
    }
    else
    {
    $(PreferredLocale) = 'fr-CA'
    }

    Thanks in advance for your help!
    Matt
    Matthew CrowshawUser is Offline
    wading in the water
    wading in the water
    Posts:20
    Avatar

    --
    12-27-2012 12:27 PM
    Sorry I forgot: DR/DNN versions: 4.20.20.0 / 6.2.5
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    01-02-2013 08:43 AM
    Hello Matthew,

    Unfortunately JavaScript can't connect to a database on it's own. Meaning that with JavaScript you can't directly update a DNN Profile Field as these values are stored in the database.

    However you're logic is great, but ultimately the Preferred Local can't be saved to the User Profile until the Registration form is submitted.

    So I would recommend having a Hidden Field on your Registration form with the Shortfield name of "PrefLocale". Have this field mapped to Preferred Locale DNN Profile Property.


    You can then use the same logic from above:

    if($(PrefLang) != 'French')
    {
    $(PrefLocale) = 'en-CA'
    }
    else
    {
    $(PrefLocale) = 'fr-CA'
    }

    So as you can see the selected value will be stored into a hidden field(PrefLocale) and upon form submission this value will be saved to the User's profile property field "PreferredLocale".

    Please let me know if you have any questions.

    Thanks,

    Ryan
    Matthew CrowshawUser is Offline
    wading in the water
    wading in the water
    Posts:20
    Avatar

    --
    01-03-2013 03:16 PM
    Thanks I will give it a try.
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    01-08-2013 10:10 AM
    Let me know if how it worked for you.

    Thanks,

    Ryan


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