0

Team,

My client has a sharepoint list and would like to have -

URL field to be prefilled with required URL address in SPS2013 List

Any suggestion would be of great help.

0

For the hyperlink field you won't be able to set the default value through the list settings.

JS Approach - Edit the lists' NewForm and add a Script Editor WebPart with JS code to set the value by selecting the hyperlinks' Input DOM element.

InfoPath - Edit the list form in InfoPath and configure the default value.

--Update--

Edit the list, new form form the ribbon and add the script editor webpart, and add the below code to the script editor webpart. Change the parameter of setColumnValue funtion as required.

<script type="text/javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script>
<script type="text/javascript">
var setColumnValue = function (column, linkVal) {  
  var columnObj = $("input[Title='" + column + "']");         
   columnObj.val(linkVal);  
 }   
 $(document).ready(function() {
  setColumnValue('Link','http://rjesh.com');
 });
 </script>
  • Any reference JS code that will work in this case? – Jason Apr 20 '16 at 6:29
  • Guys, please help. – Jason Apr 21 '16 at 23:44
  • See my updated answer with the JS script. – Rajesh Sitaraman Apr 21 '16 at 23:55
  • Thanks Rajesh. On my List page I have set the field value as "Apply". Therefore, adding a script editor with the above code and modifying only the set column value section with the following, would do the job. – Jason Apr 25 '16 at 23:13
  • <script type="text/javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script> <script type="text/javascript"> var setColumnValue = function (column, linkVal) { var columnObj = $("input[Title='" + column + "']"); columnObj.val(linkVal); } $(document).ready(function() { setColumnValue('Apply','rjesh.com'); }); </script> – Jason Apr 25 '16 at 23:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.