HI all,
I am writing a
PreSaveAction function for javascript validation on Custom List Form as below:
Code:
function PreSaveAction(){
var ddlTtype = getTagFromIdentifierAndTitle("select","LookUp","Ticket Type");
var sub1 = getTagFromIdentifierAndTitle("INPUT","TextField","Subject");
var desc1= getTagFromIdentifierAndTitle("TextArea","TextField","Comment");
if (ddlTtype.value=="" || sub1.value == "" || desc1.value == "")
{
alert("Please Complete all the Required fields");
return false; // Cancel the item save process
}
if(confirm("Do you want to continue with this information?")==true)
{
alert("Successfully Submitted");
return true; // OK to proceed with the save item
}
return false;
}
In this for "SingleLineText" (Subject field) the validation works perfectly before PreSaveAction, but i'm not getting the way to validate the Dropdown or lookup and MultiLineText....
and my fields in design the control looks as below:
For field Ticket Type:(which is a Lookup)
Code:
<SharePoint:FormField runat="server" id="ff2{$Pos}" ControlMode="New" FieldName="Ticket_x0020_Type" __designer:bind="{ddwrt:DataBind('i',concat('ff2',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Ticket_x0020_Type')}"/>
<SharePoint:FieldDescription runat="server" id="ff2description{$Pos}" FieldName="Ticket_x0020_Type" ControlMode="New"/>
For field Subject:(SingleLineText)
Code:
<SharePoint:FormField runat="server" id="ff3{$Pos}" ControlMode="New" FieldName="Subject" __designer:bind="{ddwrt:DataBind('i',concat('ff3',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Subject')}"/>
<SharePoint:FieldDescription runat="server" id="ff3description{$Pos}" FieldName="Subject" ControlMode="New"/>
For field Description:(MultiLineText)
Code:
<SharePoint:FormField runat="server" id="ff4{$Pos}" controlmode="New" fieldname="Comment" __designer:bind="{ddwrt:DataBind('i',concat('ff4',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Comment')}" />
<SharePoint:FieldDescription runat="server" id="ff4description{$Pos}" FieldName="Comment" ControlMode="New"/>
Please help me on this....
Thanks in advance