locked
MaskedEdit Extemder for facebook page name. RRS feed

  • Question

  • User944339287 posted

    hi guys..  how can i make sure customer keyin proper facebook page name in my textbox?

    for an instance.. facebook page name is www.facebook.com/Microsoft

    how can i display www.facebook.com in my textbox automatically when is OnFocus.. 

    and user only need to enter page number (Microsoft)

    just wanna make sure proper facebook page name is enter and saving time for user. pls advise. TQ

    Monday, October 13, 2014 9:07 AM

Answers

  • User61956409 posted

    Hi kengkit,

    Thanks for your post.

    how can i display www.facebook.com in my textbox automatically when is OnFocus.. 

    As for your problem, you could refer to the following sample to meet above your requirement via jQuery.

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <script src="../../Scripts/jquery-1.8.2.js"></script>
        <script>
            $(function () {
                var facebookpage = " www.facebook.com ";
    
                $("#txtpn").mousedown(function () {
                    $(this).val(facebookpage);
                })
    
                $("#txtpn").blur(function () {
                    var txt = $(this).val();
                    if (txt == facebookpage) {
                        $(this).val("");
                    }
                })
            })
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:TextBox ID="txtpn" runat="server"></asp:TextBox>
        </div>
        </form>
    </body>
    </html> 
    

    If you have any question about my reply, Please let me know freely.

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 14, 2014 1:27 AM