php - alert message displays in new window -


i want display alert message if condition fails.so used following code display message

print '<script type="text/javascript">'; print 'alert("you cannot leave field empty")'; print '</script>';  

it works fine problem is, showing message in new window blank page background.i need show message in same window.please figure out way this.

thanks in advance.

show on load

print '<script type="text/javascript">';     print 'window.onload = function(){'     print 'alert("you cannot leave field empty")';     print '};' print '</script>';  

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -