My name is Santosh and I am a sharepoint developer. I am developing a on boarding for my company using designer 2010. we dont have infopath services, just sharePoint foundation. When a new employee request is approved, it is followed by "employee software hardware checklist" which is followed by "New PC" Request and there are several other requests depending on the items selected in the checklist. I have used one big list for all these different forms. Only "New Employee Request" will be NewForm.aspx rest everything is EditForm.aspx.

My problem I have required columns in each different form which the requester must fill at each stage, since all columns are in one list i have not declared columns as a required fields. Is there anyway that I can validate these columns not be empty when the corresponding form is opened and instead of submit button I am using FormAction button to submit data.

any help is appreciative. Thanks a lot

2 Answers 2


Sure, you can add an onclick event to your save buttons in SPD, and that link to a javascript function like:

function saveForm() {
var colName = "Your column name";
var type;
var yourColumnValue;
var submit = document.getElementById("ctl00_m_g_7f9b0338_d639_4e29_8f31_e3bc60099584_ff371_ctl00_DropDownChoice").value;    
if((this.Obj = $("select[Title='" + colName + "']")).html() !== null) {
    yourColumnValue = (this.Obj.find("option:selected").text());
} else if((this.Obj = $("input[Title='" + colName + "']")).html() !== null) {
    yourColumnValue = (this.Obj.attr("value"));  }  
if(affiliationValue == "") {
    alert("Your Alert Here.");
    return false; }

This is for a dropdown, but gives you a general idea for what you can do with it.


If you are using sp 2010 add a content editor webpart to the form and in ti add the JavaScript block and PreSaveAction function

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.