Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Manipulating SharePoint Form fields with Jquery

$
0
0

Hi,

I am trying to manipulate the below span in the following output from a SharePoint form using jquery.

Here is the jquery code I am using.

     $("span[id*='LibID']").each(function () {
       alert('elemement found');
       this.val("blah blah");
     });
    

Also tried using the direct ID as per viewsource output.

  $("#WPQ2469bc064-103c-4e5b-8df7-7119c4620c84LibID").val("blah blah");

Still doesn't work. Can someone tell me what I am doing wrong?

----------------------------------------------------------------------html to manipulate-------------------------------------------------

<td valign="top" width="350px" class="ms-formbody">
  <!-- FieldName="LibID"
    FieldInternalName="LibID"
    FieldType="SPFieldText"
    -->
   <span id='WPQ2469bc064-103c-4e5b-8df7-7119c4620c84LibID' data-sp-control='SPFieldText' data-sp-options='{&quot;mode&quot;:3,&quot;source&quot;:&quot;LibID&quot;}'></span>
      
</td>


Sherazad



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>