Tuesday 20 May 2014

Dropdownlist and text box required field with javascript Alert

function ValidateFiles1() {

        var IPR = document.getElementById('<%=ddlIPR1.ClientID%>').value;
        var Domain = document.getElementById('<%=ddlDomain1.ClientID%>').value;
        var Product = document.getElementById('<%=ddlProduct1.ClientID%>').value;
        var AppNo1 = document.getElementById('<%=txt_applicationno.ClientID%>').value;
        var opponentname = document.getElementById('<%=txt_opponentname.ClientID%>').value;
        var Oppositionno = document.getElementById('<%=ddl_oppositionno.ClientID%>').value;


    if (IPR == null || IPR == "" || IPR == "Select") {
            alert("Please Select IPR");
            document.getElementById('<%=ddlIPR1.ClientID%>').focus();

            return false;
        }

        if (Domain == null || Domain == "" || Domain == "Select") {
            alert("Please Select Domain");
            document.getElementById('<%=ddlDomain1.ClientID%>').focus();
            return false;
        }

        if (Product == null || Product == "" || Product == "Select") {
            alert("Please Select Product");
            document.getElementById('<%=ddlProduct1.ClientID%>').focus();
            return false;
        }

        if (opponentname == null || opponentname == "") {
            alert("Please Enter Opponent Name");
            document.getElementById('<%=txt_opponentname.ClientID%>').focus();
            return false;
        }

        if (Oppositionno == null || Oppositionno == "") {
            alert("Please Enter Opposition No");
            document.getElementById('<%=ddl_oppositionno.ClientID%>').focus();
            return false;
        }

        if (AppNo1 == null || AppNo1 == "") {
            alert("Please Enter Application Number");
            document.getElementById('<%=txt_applicationno.ClientID%>').focus();
            return false;
        }

        var cmbID = "<%=ddlcountries.ClientID %>";
        if (document.getElementById(cmbID).selectedIndex == 0) {
            alert("Please select Country");
            return false;
        }
        return true;



dropdown id like = ddl_oppositionno... etc

Monday 19 May 2014

Sharepoint DateTimeControl: clear the string empty

Sharepoint DateTimeControl:  clear the string empty

Design

<td class="DateTd">
                                <SharePoint:DateTimeControl ID="Dateofopposition" runat="server"  DateOnly="true" />
                            </td>
                     


in c#

Dateofopposition.ClearSelection();