proudly Posted February 12, 2015 Share Posted February 12, 2015 Hello, could someone give some advice, how I can collect the data from a user that types some information in a form tag, or examble an <input>.?Where are they going , in order to manipulate them?Thank in advance Link to comment Share on other sites More sharing options...
Ingolme Posted February 12, 2015 Share Posted February 12, 2015 Forms submit to a server-side program which can operate with the data, save the data in a file, or in store it in a database. You could start by learning PHP. 1 Link to comment Share on other sites More sharing options...
tejasamrute Posted February 13, 2015 Share Posted February 13, 2015 http://www.freecontactform.com/email_form.php 1 Link to comment Share on other sites More sharing options...
proudly Posted February 13, 2015 Author Share Posted February 13, 2015 thank you Tezzo and Ingolme .I would like to leanr about a Javascript solution(because already reading that Language), where can i start? Link to comment Share on other sites More sharing options...
Ingolme Posted February 13, 2015 Share Posted February 13, 2015 There are things Javascript just can't do. If you want to be a web developer you have to learn all the necessary technologies. Javascript can manipulate objects on the page, including form elements, but it cannot save the data onto the server. A server-side language is required for that. This example will show you how to read the data from a form field in Javascript: http://www.w3schools.com/js/js_validation.asp You can save the data you read into a cookie or localstorage, but you will not be able to access that data from any other computer than the user's own computer. 1 Link to comment Share on other sites More sharing options...
proudly Posted February 14, 2015 Author Share Posted February 14, 2015 thank you Ingolme, so I have to start learning PHP Link to comment Share on other sites More sharing options...
igwegbelaw Posted March 11, 2015 Share Posted March 11, 2015 Hi I am having challange as regard how to get the click value of Navigaion elements like "Home" "About" "Contact" etc. what i mean how to write appropriate codes for the HTML and CSS so that once one clicks on any of them the appropriate value is displayed or one get to the link. i know it is to be done using DOm put dont know how yet. can you help me or get me to someone who wouyld. thanks Link to comment Share on other sites More sharing options...
davej Posted March 11, 2015 Share Posted March 11, 2015 Maybe something like this? <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"/><title>title</title><style>[type=button]{margin:10px 0}#out{width:200px;border:1px solid #ccc;}</style><script>window.onerror = function(a, b, c, d){alert('Javascript Error:n'+a+'nURL: '+b+'nLine: '+c+' Column: '+d);return true;}</script><script>'use strict';window.onload = init;function init() { document.getElementById('btnHome').onclick = fnHome; document.getElementById('btnAbout').onclick = fnAbout; document.getElementById('btnContact').onclick = fnContact; document.getElementById('btnClear').onclick = fnClear;}function fnHome(){ alert('Home was clicked');}function fnAbout(){ var str = "<h3>Values:</h3>"; str += document.getElementById('name').placeholder + " = "; str += document.getElementById('name').value + "<br/>"; str += document.getElementById('street').placeholder + " = "; str += document.getElementById('street').value + "<br/>"; str += document.getElementById('city').placeholder + " = "; str += document.getElementById('city').value + "<br/>"; str += document.getElementById('state').placeholder + " = "; str += document.getElementById('state').value + "<br/>"; document.getElementById('out').innerHTML = str;}function fnContact(){ alert('Contact was clicked');}function fnClear(){ var list = document.getElementsByTagName('INPUT'); for (var i=0 ; i<list.length ; i++){ if (list[i].type=='text'){ list[i].value = ""; } } document.getElementById('out').innerHTML = "";}</script></head><body><h3>Information:</h3><input type="text" id="name" placeholder="Name"/><input type="text" id="street" placeholder="Street"/><br/><input type="text" id="city" placeholder="City"/><input type="text" id="state" placeholder="State"/><br/><input type="button" id="btnHome" value="Home"><input type="button" id="btnAbout" value="About"><input type="button" id="btnContact" value="Contact"><input type="button" id="btnClear" value="Clear"><div id="out"></div></body> </html> Link to comment Share on other sites More sharing options...
MrPlus Posted March 12, 2015 Share Posted March 12, 2015 I'm having this problem Link to comment Share on other sites More sharing options...
proudly Posted March 12, 2015 Author Share Posted March 12, 2015 I'm having this problem ..the problem you are showing is a headache first on the html file you need this : <form method="post" action="results.php" onsubmit=""> <input type="text" name="name" required > then on results you need that $name = $_POST["name"]; Those two files communicate via a server eg Apache. You have to install one Link to comment Share on other sites More sharing options...
Ingolme Posted March 13, 2015 Share Posted March 13, 2015 ..the problem you are showing is a headache first on the html file you need this : <form method="post" action="results.php" onsubmit=""> <input type="text" name="name" required > then on results you need that $name = $_POST["name"]; Those two files communicate via a server eg Apache. You have to install one Why do you have an empty onsubmit attribute on your <form> element? Link to comment Share on other sites More sharing options...
proudly Posted March 13, 2015 Author Share Posted March 13, 2015 (edited) to show him that he could use it if he wants Edited March 13, 2015 by proudly Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now