php:
<?php
if (empty($itemId)|| (empty($title) && $title==="Please Select")
|| empty($subtitle) || empty($descript)
|| empty($availability)
|| empty($price) || empty($filename))
{
echo "<script type='text/javascript'>
";
'emptyfield()';
echo "</script>";
}
>?
javascript:
function emptyfield()
{
if(document.forms ["add"] ["save"].value !== "")
{
document.getElementById('display').innerHTML="Please fill the blank fields!!!";
}
}
The java script file does not trigger in the php file. When I click the submit button, I need the div to be displayed as "Please fill the blank fields". But it does not happen in my case.