Hi All,
Firstly - I know my javascript/jQuery is pretty terrible - please feel free to 
abuse me and give me examples of what I need to do better :)
I am trying to use javascript to hide the "Name" field on a list form if the 
content type is of a specific type (I will set the Name value in the 
PreSaveAction when save is clicked). However when my $(document).ready function 
runs to do the check and hide the field, it runs before the List web part has 
added the field control objects to the DOM.
I have tried using $(window).load as well.
The closest I have come to making it work the way I want is to get the SELECT 
ctrl for the Content Type, and then override its onchange value. However then 
the function "ChangeContentType" is undefined:
jQuery(document).ready(function() {     var ctSelect = jQuery('table#formTbl > 
tbody > tr:nth-child(1) > td.ms-formbody > select');     alert("Start);  
ctSelect.bind("onchange", function() {                  
ChangeContentType(ctSelect.attr('id')); /* THIS IS UNDEFINED */
                var contentTypeRow = jQuery('table#formTbl > tbody > 
tr:nth-child(1)');         var nameRow = 
jQuery('nobr:contains("Name")').closest("tr")                     var 
ctSelectVal = jQuery('table#formTbl > tbody > tr:nth-child(1) > td.ms-formbody 
> select option:selected');          alert(ctSelectVal.text());                 
     // If this is Lease Matrix Document Set         if (ctSelectVal.text() == 
"Lease Matrix Document Set") {                        contentTypeRow.hide();    
              nameRow.hide(); }               return false;   });});
Can someone point me in the right direction?
Cheers,
Nigel                                     
_______________________________________________
ozmoss mailing list
ozmoss@ozmoss.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss

Reply via email to