Skip to main content

Posts

Showing posts from 2016

TechCS: JavaScript Part-2: How to send HTML form data with preserving line breaks in the textarea

Preserve line breaks in <textarea> while sending the HTML form data using JavaScript. Hi friends, Hope you are enjoying the time. Today I am posting a small trick about drafting mail to the given user using Javascript. Look at the following simple HTML page. The page includes user email address, subject and message body.   I have used <textarea> for getting the message body. You would be knowing that form input fields does not preserve the new line character (pressing "ENTER" button in the textarea ). Here I am writing a simple code to preserve your line break or new line character while submitting the HTML form. Look at the following code: <html> <head> <title> CS-Sending Mail preserving Line breaks in the < textarea > </title> <style>      textarea{white-space: pre-wrap;}     input{width: 250px; height: 25px; margin-top: 10px; padding: 2px;  }     .main{width: 1010...

Search using Javascript: Part - 1 Searching the text from html table

Hi all, Here is my first programming stuff. This demo is about implementing search operation on your webpage. Here is the source code: HTML and JavaScript: <!DOCTYPE html> <html> <head> <title>Searching the text html table </title> <style>  table{border: 1px solid #000 }  td{border: 1px solid #000; font-size: 20px; padding: 10px; }  tr:nth-of-type(even){background-color: yellow; } </style> </head> <body> <h3> Table</h3><p></p> <table class="tabl" name="tabName1" id="tabId1"> <tr>  <th class="tdClassname"> Name </th> <th class="tdClassname"> Acc No </th> <th class="tdClassname"> Branch No </th> <th class="tdClassname"> Tel </th> </tr> <tr>  <td class="tdClassname"> Name 11 </td> <td ...