How to pass along a string in HTML PHP -
#!/usr/local/bin/php <!doctype html> <html> <head> <script> function sendinfotochart() { document.getelementbyid("firstn").innerhtml=document.getelementbyid("firstname").innerhtml; } </script> </head> <body> <form action=""> first name: <input type="text" name="firstname" id="firstname"><br> <button onclick="sendinfotochart()"> submit </button> </form> <br><br> <table border="1" cellpadding="4" style="font-style:italic;"> <tr><td><p id="firstn"></p></td><td>middlename</td><td>last name</td></tr> </body> </html>
i trying pass word type in text field , pass table when click button. cant figure out how pass along... ahead of time!
you have use `value property of text box text , prevent form submitting see change,.
document.getelementbyid("firstn").innerhtml=document.getelementbyid("firstname").value; ... <button onclick="sendinfotochart();return false;"> submit </button>
Comments
Post a Comment