Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Need Help Manipulating Form Fields/Rows using jQuery

$
0
0

Details:

- Using the 'jquery-1.7.2.min.js' library

Right now I have a list setup with over 20 columns, however this is to provide the user with additional fields when they are creating a new list item. All of these columns may nothave data in them once the user has submitted the form. I am trying to setup the DispForm so that when it shows the details of the list item when opened from the sharepoint site it does not clutter the page by showing unnecessary blank rows/fields/columns of data(I would eventually like to have it so that it only shows valid data relative to the selected item). I would like to use jQuery, as this appears to be the standard method(based on internet searching), to hide that row from the form if that column/field should happen to be empty. So far I have had no luck.

To test some jQuery code, I have for example a Column of the list called 'Plant#' and in one of the items I have submitted the 'Plant#' = 200. However when I try to display/read that value using jQuery it shows 'undefined' or ''<-(nothing)(based on slight variations of the code below). Below is the simplest code sample I have tried to use.

<html>
        <script src="/jQuery/jquery-1.7.2.min.js" type="text/javascript"></script>
        <script type="text/javascript">
 
        $(document).ready(function(){
                var plantVAL = $("input[title='Plant#']").val();
                alert("PlantVAL="+plantVAL+".");
  
        });
        </script>
</html>

Any help you can provide, as always, is most appreciated. Thank you.


Viewing all articles
Browse latest Browse all 11571

Trending Articles



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