Is there a way to include javascript code in a PHP file?
I have the following code I want to embed in a php file, which was originally an HTML file :-
<script language="JavaScript" type="text/javascript">
<!--
function checkform ( form )
{
if (form.fname.value == "") {
alert( "Please enter your Name. الرجاء إدخال الإسم" );
form.fname.focus();
return false ;
}
else if (form.civilid.value == "") {
alert( "Please enter your Civil id. الرجاء إدخال الرقم المدني " );
form.civilid.focus();
return false ;
}
----end----of---code---
if anybody knows, please do respond.
I have the following code I want to embed in a php file, which was originally an HTML file :-
<script language="JavaScript" type="text/javascript">
<!--
function checkform ( form )
{
if (form.fname.value == "") {
alert( "Please enter your Name. الرجاء إدخال الإسم" );
form.fname.focus();
return false ;
}
else if (form.civilid.value == "") {
alert( "Please enter your Civil id. الرجاء إدخال الرقم المدني " );
form.civilid.focus();
return false ;
}
----end----of---code---
if anybody knows, please do respond.
