How do you write specific data to an HTML table?

Accessing data from HTML table?

  • Hi friends I am beginner (HTML). so please give simple answer as much as possible. want to add some number which are in HTML table. but don't know how to access the numbers from table. //my program look like this <table> <from> <tr><td><input type="checkbox" id="1" value="20"></td> <td><input type="checkbox" id="2" value="30"></td> <td><input type="checkbox" id="3" value="40"></td></tr> </form> </table> I want to add the values which are in columns with the help of a BUTTON. This happens when only the check box is selected.

  • Answer:

    First off, it's HTML, and not a program. Opening and closing HTML tags are required. Body tags are also required inside the HTML tags. Your table tags belong inside the form tags, not as you have them. Your opening form tag has been misspelled as "from" - this needs correction. Form tags have required action and method attributes; these attributes can be null, for example, action="". You need JavaScript to parse the values and return the result - for example: <html> <head> <script type="text/javascript"> function validate(){ var rslt = new Number(); var a=new Number(document.getElementById('1').valu… var b=new Number(document.getElementById('2').valu… var c=new Number(document.getElementById('3').valu… rslt=a+b+c; alert("Result: "+rslt); } </script> </head> <body> <form action="" method=""> <table border="1"> <tr> <td><input type="text" id="1" value="20"></td> <td><input type="text" id="2" value="30"></td> <td><input type="text" id="3" value="40"></td> </tr> <tr> <td colspan="3" align="center"><input type="button" onclick="validate();" name="" value="Submit"></td> </tr> </table> </form> </body> </html>

shilp at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

Can you provide more of a discussion as to what the problem is and what the expected result might be? Also at first glance, your open form tag is spelled incorrectly. It should be <form> not <from>

The First Thing U need to know , If U want to have a good ,clear and best answer , You have to question clearly. Dont puzzle others by your question ok ?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.