Forum Moderators: coopster
I've been trying this for a while, im struggling as it seems i would have to write and IF statement for every field I need checking.
Please help
Thanks
covers the basics of testing submitted fields
$name = "text1";
function check($name)
{
if(!isset($_POST[$name]) ¦¦ (empty($_POST[$name]))) return "Please fill in the $name field"; //or just echo it. But remember to use " quotes, not ' apostrophes!
}
Hope it helps!
Michal Cibor
PS You can do this in js as well, but remeber to place it before submiting the form. So don't put it in <input>s, but in <button onclick="js_check(); return false;">Bla</button>