How to include a java script in a form

rss

Posted by MES5464 - Sep 19 ’13 at 05:08

I want to use the Date.js script in my forms. How do I reference it?

I don't think using this in the javascript panel is right: <script src="date.js"></script>

  • MES5464
    Member
    Member for: 8 years 11 months 20 days
    #1 by MES5464 Sep 19 ’13 at 05:45

    I acomplished this by adding an HTML control to the form and added the <script> tag to the date.js.

    It works, but is this the best way to do this?

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 8 years 10 months 24 days
    #2 by Dmitry Kozlov Sep 21 ’13 at 03:46

    Sure, you can include script with HTML-control, but if this script is used in multiple forms it will be better to include it in the master-page.

  • MES5464
    Member
    Member for: 8 years 11 months 20 days
    #3 by MES5464 Sep 23 ’13 at 11:25

    In my "Master Pages" in SharePoint Designer I have the following:

    AdvancedSearchLayout.aspx

    DefaultLayout.aspx

    minimal.master

    NewsHomeLayout.aspx

    oslo.master

    PeopleSearchResults.aspx

    ReportCenterLayout.aspx

    SearchMain.aspx

    SearchResults.aspx

    seattle.master

    TabViewPageLayout.aspx

    v4.master

    welcomelayout2.aspx

     

    My guess is I should put the <script> tag in either the:

    DefaultLayout.aspx

    oslo.master

    seattle.master

    In which file should I put the script tag?
  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 8 years 10 months 24 days
    #4 by Dmitry Kozlov Sep 24 ’13 at 01:50

    [#3]: Your current master-page is seattle.master

Displaying 1 to 4 of 4 messages