Advertisements

Archive

Posts Tagged ‘JavaScript’

AngularJS Form Validation – Disable Submit / Confirm Password Custom Directive

January 21, 2016 Leave a comment

http://jsfiddle.net/rahuladmin/9ew85Lp3/

Hope this help !

Advertisements

Bootstrap collapse: Change display of icons and text

December 17, 2015 Leave a comment

To Change display of icons and text for bootstrap Collapse use following

http://jsfiddle.net/rahuladmin/s52h0sbj/

Hope this help !

Add Days to Javascript Date Object

November 19, 2015 Leave a comment

To add days to javascript date object use following syntax

var dayOffset = 20;

var millisecondOffset = dayOffset * 24 * 60 * 60 * 1000;

december.setTime(december.getTime() + millisecondOffset);

Open FancyBox from Code behind on button click

November 25, 2014 Leave a comment

Add link like following which redirect to popup page that you want to open on button click using fancybox

[1] <a href=”../Scripts/ValidationMessage.aspx” class=”fancybox fancybox.iframe” id=”hiddenlink_confirm” />

Add following js function on head of page along with fancybox script

[2] <script type=”text/javascript”>

function OpenValidationMessagePopup() {
var alink = document.getElementById(“hiddenlink_confirm”);
alink.click();
}

[3] Write following code on button click event

Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click

Dim sb As New StringBuilder()

sb.AppendFormat(“OpenValidationMessagePopup();”)
ScriptManager.RegisterStartupScript(Me.Page, Me.[GetType](), “OpenValidationMessagePopup” + DateAndTime.Now, sb.ToString(), True)

End Sub

Will add some more information to the above steps, hope this help !

Javascript ‘confirm()’ Cancelling Post Back

November 24, 2014 Leave a comment

Problem : Postback is not working on javascript confirm() Click

Solution :

 <asp:Button runat="server" ID="btnSubmit" Text="Submit" OnClick="BtnSubmit_Click"
 OnClientClick="if (!confirm('Are you sure you want to Submit?')) return false;"/>

Hope this help !

 

 

How to find control with in repeater on button click event

December 10, 2013 Leave a comment

<asp:Repeater ID=”RptInfo” runat=”server”>

<ItemTemplate>

<asp:Panel ID=”pnlReadonly” runat=”server”>

….

</asp:Panel>

</ItemTemplate>

</asp:Repeater>

Code : 

Protected Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click

Dim pnlReadonly As Panel = DirectCast(RptSoccerInfo.Items(0).FindControl(“pnlReadonly”), Panel)

If (Not pnl Is Nothing) Then
‘ some code
End If

End Sub

Will add some more detail soon .