a couple of questions (never done javascript before). Below is part of the what happens on submit, what is something, the action, the php script its sent to?
Also is there any software you guys reccomend for checking you’re javascript, like the equivalent of an ide? im using notepad++.
Is the rest the right sort of idea? I’m using several else ifs for each method, checking valid == true.
<SCRIPT LANGUAGE="JavaScript">
<form action="something" onsubmit="return ok()">
function ok() {
if (validate_Info() == false)
{
alert('Please enter a name');
return false;
}
else if
else if
Yes, the
actionattribute in the form tag is the URL that the form will be sent to.You are using some pretty old example code, the
languageattribute has been deprecated for a long time. Here is an example that is more up to date with current coding standards:As you see, there is no need to use an
elseat all. As you are returning from inside theifstatement, theelseis pointless.