Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Changing default value of a checkbox

  Asked By: Rohit    Date: Nov 17    Category: Sharepoint    Views: 2814

In my SPS 2003 document libraries, I upload a lot of documents. The default
value for the field "Add a listing for this document" is CHECKED but I would
like to modify it to be unchecked by defaut. Which file should I modify and
with which tool?



1 Answer Found

Answer #1    Answered By: Adya Khavatekar     Answered On: Nov 17

There is no easy solution for this problem. We had the similar need a few months
ago and after analyzing the html code that Sharepoint generate we concluded that
there were no elegant way to achieve this. We couldn't locate where was the
checkbox listing defined.

Basically the "Add Listing" column is NOT part of the standard CAML schema, it
is being generated dynamically by the upload.aspx file located each the document

In order to implement your request you will need to modify the upload.aspx page
for the document library in question and add the following code in after the
following line

<script language=javascript>

var fCtl=false;

ADD the code below

document.attachEvent ('onreadystatechange', UpdateLastRow);

function UpdateLastRow()

{ if (document.readyState=="complete")

{ document.all.submitlst.checked = false; }


This will force the checkbox  to become unchecked at the end of the page load

In order to make this change global to all document libraries, you will need to
modify the upload.aspx in the template directory

C:\Program Files\Common Files\Microsoft Shared\web server
extensions\60\TEMPLATE\1033\SPS \LISTS\DOCLIB (Where SPS is the site template
you want to change, may need to do this for every other template as well)

Didn't find what you were looking for? Find more on Changing default value of a checkbox Or get search suggestion and latest updates.