DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Username and current datetime in HTML code

Sort:
You are not authorized to post a reply.
Page 1 of 212 > >>





Growing Member





    I am in the process of trying to add some new functionality to an old site that I have inherited, and am trying to upgrade..

    I have managed to upgrade to 9.1.1, and I have a number of screens that write back to a database, via html code.

    I am trying to add username and current date to the screen itself in 2 test boxes, with this then passed through html to the database via a stored procedure, this could be for updates or new entries.

    I have tried to add a number of ways of doing a html date time as (dd/mm/yyyy hh:mm) but nothing seems to work, as the text box is nebver populated, but no error happens, and I cannot seem to get the username from dnn, has anyone got any code snippets they could share for me to try and solve this, I would be really grateful.






    Veteran Member





      Jeff,
      which module are you using (see module type on first tab of module settings).
      DNN HTML module does support "Tokenreplace" feature, where you may add [User:DisplayName] or [DateTime:Now|dd/mm/yyyy hh:MM], a full list may be found on DNN Docs.





      Veteran Member





        Jeff,

        in addition to what Sebastian said: Token Replacement has to be activated in the DNN Text/HTML module settings.

        Happy DNNing!
        Michael

        Michael Tobisch
        DNN★MVP

        dnnWerk Austria
        DNN Connect





        Growing Member





          Hi Sebastian

          Thanks for the response..

          If I am right, the module is XModPro, which part of DNN Docs does the reference appear, I can have a look and see if this points me in the right direction.






          Growing Member





            Hi Michael

            Thanks for that, were would I find those settings?






            Veteran Member





              Jeff,

              XModPro is a third party module and not a core DNN module. Please contact the vendor, or see the documentation, use the forum etc. on https://www.dnndev.com/

              Happy DNNing!
              Michael

              Michael Tobisch
              DNN★MVP

              dnnWerk Austria
              DNN Connect





              Growing Member





                Thanks for all the help, having dropped onto dnndev, I have managed to find the answers to my question, so i now the data I need.






                Growing Member





                  Spoke to soon, getting this

                  SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.

                  when passing the date to SQL via the html code to the sp.






                  Veteran Member





                    the sql error is most likely caused by the datetime format.
                    you may pass a string to the sproc, which converts it to a datetime value.





                    Growing Member





                      Thanks for that, managed to solve it, now new issue, not passing through a new field value to the database, checked all the values, can see the value in the text box, but nothing in database, picking aprt the sp and code now to try and resolve this.

                      One step forward...

                      You are not authorized to post a reply.
                      Page 1 of 212 > >>

                      These Forums are dedicated to the discussion of DNN Platform.

                      For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

                      1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
                      2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
                      3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
                      4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
                      5. No Flaming or Trolling.
                      6. No Profanity, Racism, or Prejudice.
                      7. Site Moderators have the final word on approving / removing a thread or post or comment.
                      8. English language posting only, please.

                      Would you like to help us?

                      Awesome! Simply post in the forums using the link below and we'll get you started.

                      Get Involved