This problem cannot be completely resolved using the help window. To solve this problem, you should create a jQuery user interface user interface dialog box.
Basically, you create a text box and two OK and Cancel buttons inside the form tag and paste the code into jQuery so that they pop up like a tooltip.
I used the default functions dialog on this page http://jqueryui.com/dialog/#default as my foundation ...
An explanation for the code is given at the end.
Here is the complete code for this ...
<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>jQuery UI Dialog - Default functionality</title> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script> <script> $(document).ready(function () { $('#dialog').dialog({ autoOpen: false, width: 250, height: 180, modal : true, resizable: false, show:"slow" }); $('#put').click(function() { $( "#dialog" ).dialog( "open" ); }); }); function getPdata( arg ) { </script> </head> <body> <div> <button type="button" id="put" >Insert data</button> </div> <div id="dialog" title="Input Data"> <form id="pForm" > name: <input type="text" name="name" width='50' height='100' maxlength="10" placeholder="Fill in your data" /><br><br> <input type="button" value="OK" onclick="getPdata1()" /> <input type="button" value="cancel" onclick="getPdata( this.value )" /> </form> </div> </body> </html>
Explanation for the code ..
- A button is displayed on the web page. A dialog box appears with a text box and 2 commands.
- Entrance was limited to 10 characters.
- The entered data will be printed on the web page under the button as an output.
- Entrance will be accepted 5 times when the counter is specified up to 5 ..
The above code can be completely changed according to individual needs. Hope this answer is helpful. If in doubt, please feel free to ask.
source share