Search code examples
sharepoint-2010sharepoint-2007

Insert javascript code in a list form.


I have a list, and want to insert custom javascript code in a new form for this list (when form loaded). For example, when new form for this list is opened, I want to make some layout modifications for this form.

How it can be done? And how many ways exist to achieve this?

Thanks.

Upd: I ask about SharePoint list, and SharePoint list forms, I suppose you look at the tags of the question :).


Solution

  • You put tags for both SharePoint 2007 and 2010 and the methods are a bit different.

    I agree with the previous post that with SP2010 you can simply use InfoPath designer for form design and do whatever you like to the look.

    In SharePoint 2007, there are a couple ways incuding using SharePoint Designer, editing the form .aspx file, hiding the out of the box form and inserting a custom form which you will then be able to edit. You can also add in JavaScript code there as well.

    My preferred method if you are just making some visual modifications is always JQuery which you can add in to a content editor and you can look for the particular tags surrounding rows or columns and attach to them and make your changes.

    I think your question and tags need further clarification to get an articulate answer from anyone that will actually help you.