Advertisement
Guest User

html code

a guest
Jul 31st, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.38 KB | None | 0 0
  1. <form action="http://www.web2generators.com/html/entities" id="html_entities_form" class="main_form" method="post">
  2. <label for="html_input">Text input:</label>
  3. <textarea name="html_input" cols="30" rows="10" id="html_input">
  4. </textarea><div id="html_form_buttons">
  5. <input name="submit" value="Encode text" id="html_encode_submit" type="submit">
  6. <input name="submit" value="Decode text" id="html_decode_submit" type="submit">
  7. <input name="reset" value="Clear" id="html_input_reset" type="reset">
  8. </div>
  9. </form>
  10.  
  11. <script type="text/javascript">
  12.     $(document).ready(function()
  13.     {
  14.        
  15.         function attachEncodeDecode(sElement)
  16.         {
  17.             $(sElement).click(function(){          
  18.                 $.post('http://www.web2generators.com/html/entities', {
  19.                     'html_input': $('#html_input').val(),
  20.                     'submit': $(sElement).val(),
  21.                     'bAjax': 1
  22.                 }, function(sData){
  23.                     $("#html_output").animate({
  24.                         opacity: 0
  25.                     }, 1).animate({
  26.                         opacity: 1
  27.                     }, 500);
  28.                     $("#html_output").html(sData);
  29.                 });
  30.                 return false;
  31.             });
  32.         }
  33.  
  34.         // Attach to encode
  35.         attachEncodeDecode('#html_encode_submit');
  36.         attachEncodeDecode('#html_decode_submit');
  37.  
  38.         // Clear the field
  39.         $('#html_input_reset').click(function(){
  40.             $('#html_input').text('');
  41.         });
  42.        
  43.     });
  44. </script>
  45.  
  46. <h3>Output</h3>
  47.  
  48. <div id="html_output" class="output_element">
  49.             Input some data to be encoded or decoded.   </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement