locked
Set a default value for HyperLink Datatype RRS feed

  • Question

  • Hello,
    I have a list where my client is trying to see a default value for on new item for SharePoint List that has HyperLink. So users should not worry about adding url and description, because the information is always the same. 

    Is it possible using JS/JQuery to set a default value for New Item on List, not using InfoPath? 

    To have a static value for hyperlink datatype with Url and Text description embedded in new Item. 

    Thanks


    Abenet

    Tuesday, June 2, 2020 12:38 PM

All replies

  • Hi,

    Sure, you could use JS/jQuery to achieve this.

    Sample(you only need to change the column name to yours, and add your value in val()):

    <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
    <script>
    $(function(){
    $("input[title='testLink']").val("http://www.google.com");//testLink is my column name, you need to change to yours 
    $("input[title='Description']",$("input[title='testLink']").closest("td")).val("testDescription");
    })
    </script>
    

    Best Regards,

    Amos


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Wednesday, June 3, 2020 2:50 AM
  • Hi,

    Would you please provide us with an update on the status of your issue?

    Best Regards,

    Amos


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, June 8, 2020 1:14 AM
  • For somereason it has not worked for me

    Abenet

    Tuesday, June 16, 2020 1:20 PM
  • Hi,

    Is the code report error?Please share more information for further research.

    Best Regards,

    Amos


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Wednesday, June 17, 2020 8:45 AM
  • Hi,

    Would you please provide us with an update on the status of your issue?

    Best Regards,

    Amos


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, June 29, 2020 7:15 AM
  • Its still not working. 

    Abenet

    Thursday, July 23, 2020 5:10 PM