Click here to Skip to main content
15,889,867 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have textbox I need when I select the text shows notice like popup above text

my textbox

@Html.TextBox("ShortUrl", "this is the test", new { @class = "name_comment", @readonly = "readonly" })

What I have tried:

I tried alot of things but I need any hints because I have no idea
Posted
Updated 9-May-16 7:57am
Comments
Karthik_Mahalingam 9-May-16 12:55pm    
what do you mean by "select the text"
pop up like baloon ?
provide some sample links
Sarah Mohammed77 9-May-16 12:57pm    
I mean I need popup like baloon to show notice about the data which user select from textbox
Karthik_Mahalingam 9-May-16 13:11pm    
always use Reply button to post comments/query, else the user wont get notified.
Sarah Mohammed77 9-May-16 12:59pm    
https://goo.gl/ like ballon shows press ctrl+c in the textbox to copy data
Karthik_Mahalingam 9-May-16 13:12pm    
still not clear

1 solution

customize it based on your need using css[^]

HTML
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>

    <script>
        function showbaloon(elem) {
            elem.style.display = "block";
        }
        function hidebaloon(elem) {
            elem.style.display = "none";
        }


    </script>

    <style>
        .baloon {
            position: absolute;
            margin: 5px 5px 10px 10px;
            width: 130px;
            height: 15px;
            font-family: arial,sans-serif;
            background-color: black;
            color: white;
            font-size: 11px;
            display: none;
        }
    </style>
</head>
<body>

    <input type="text" onfocus="showbaloon(baloon1)" onblur="hidebaloon(baloon1)" id="LongUrlText2" value="some data" />
    <div class="baloon" id="baloon1">
        PRESS CTRL-C to copy
    </div>
</body>
</html>
 
Share this answer
 
Comments
Sarah Mohammed77 9-May-16 14:12pm    
it works really great you are amazing .
Karthik_Mahalingam 9-May-16 14:16pm    
Welcome :)
Sarah Mohammed77 9-May-16 15:01pm    
How can I add pointer to it ?
Karthik_Mahalingam 9-May-16 22:59pm    
refer CSS Triangle[^] to create triangle arrow

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900