> HTML for beginners?

HTML for beginners?

Posted at: 2014-12-18 
You would do this in javascript by the way. Html is the language that structures the page while that onclick calls a javascript function.

Basically you just create the function with whatever name you put there in the onclick and at the beginning of your logic you need to wrap it in an if/else that checks to see if the field is blank or not. If it is blank you can throw an alert() or make it red.

Onclick is useless. for that. Javascript is no good for serious data work. You need to learn the mysql database and php to manipulate the data and read it back to create the appropriate html according to user requests. You also MUST learn fully the dangers of accepting data input and how to validate data to avoid scripted attacks or sql injection before you put up ANY site with user input. otherwise your site will be owned by akers using ot to distribute bank phishing scams and child porn within a week.

The textbox by default is automatically blank.

You can forget about functions. Because your not thinking right.

HTML is used with a server side scripting language. Most people might think HTML forms are used with JavaScript, but all these people who think like this are WRONG.

If I am not mistaken, I think you are trying to use DHTML, and not HTML. Just forget about DHTML. Because most people don't use DHTML with forms.

I suggest you choose ONLY 1 option to make websites. Start with HTML, and don't use anything else until you become good at HTML. You would also need to learn CSS as well. Frankly I think what you are showing me looks like its sloppy, and maybe you found it somewhere on the Internet.

It takes time to become good at something. You would have to make an effort to want to learn how to make forms, and work with HTML.




id="first_name"

required/>



The above code shows a textbox and a submit button. The textbox can't be left blank or else there will be a message saying "Please fill in this field". My question is how do I incorporate the onclick attribute with the submit button. So, when the textbox is not blank, the submit button is pressed, I want it to execute a function something like -->onclick="postNameToDatabase()" (while still maintaining the blank field feature)