Hi all
I am executing the following javascript code in form submit button. I am placing the files from a server. I am able to execute the same javascript in my local sytem. The server is not allowing me to execute the script
THE FOLLOWING IS JAVASCRIPT
function newsvalidation()
{
//var d=document.news;
//document.news.newsheading.focus();
//return false;
var d=document.news;
if (d.newsheading.value =="")
{
alert("Please enter heading");
d.newsheading.focus();
return false;
}
//alert($oFCKeditor.value);
/*if (d.FCKeditor1.Value =="")
{
alert("Please Enter NewsDescription!");
d.FCKeditor1.focus();
return false;
}*/
/*if (d.newsstatus.checked == false)
{
alert ("Please select the status!");
d.newsstatus.focus();
return false;
}*/
}
THE form which runs the javascript code is as follows please help me how to solve my problem
<body>
<?php
if(isset($_GET['actionType']) && $_GET['actionType'] =='E') {
?>
<form name="news" method="post" action="addnewspage.php?action=update&id=<?php echo $newsDetails['news_id'];?>">
<?php } else if(!isset($_GET['actionType']) || ($_GET['actionType']=='')){ ?>
<form name='news' method='post' action='../FCKeditor/_samples/php/sampleposteddata.php'>
<?php } ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top"> </td>
</tr>
<tr>
<td align="left" valign="top" class="toptablebackbround"></td>
</tr>
<tr>
<td align="left" valign="top" class="tablebackgroundwhite">
<table width="1004" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="240" align="center" valign="top">
<?php include("left.php"); ?></td>
<td align="left" valign="top">
<?php
if(isset($_GET['actionType']) && $_GET['actionType']=='E') {
print '<table width="0" border="0" align="left" cellpadding="2" cellspacing="1"><tr><td width=240 align=LEFT valign=top colspan=4 class="headerNavigation">Edit News';
}
else
{
print '<table width="0" border="0" align="left" cellpadding="2" cellspacing="1"><tr><td width=240 align=LEFT valign=top colspan=4 class="headerNavigation">Add News';
?>
</td></tr><tr>
<td colspan="4" class="ErrMessage"><?php if(!empty($_SESSION['errMessage'])) echo $_SESSION['errMessage']; $_SESSION['errMessage'] =''; }?>
</td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td colspan="2" class="InputText">
<p>News Head<span class="ErrMessage"> <font color="#990000"> * :</font></span></p>
<p><input name="newsheading" type="text" size="50" value="<?php if(isset ($_GET['actionType']) == 'E') echo $newsDetails['news_heading']; ?>"></p>
</td></tr>
<tr>
<td colspan="2" width="100%"><p> News Description <span class="ErrMessage"> <font color="#990000"> * :</font></span></p>
<?php
$oFCKeditor = new FCKeditor('FCKeditor1') ;
$oFCKeditor->BasePath = '../FCKeditor/';
if(isset($_GET['actionType'])== 'E')
{
$oFCKeditor->ToolbarSet = 'Default';
$oFCKeditor->Value = 'DATA that will be edited goes in here';
$oFCKeditor->Value =$newsDetails['news_content'];
}
else
{
$oFCKeditor->Value ='';
}
$oFCKeditor->Create();
?>
</td>
</tr>
<tr>
<td colspan="2"><p> News Date <span class="ErrMessage"> <font color="#990000"> * :</font></span></p><input type="text" name="newsdate" size="10" value="<?php if(isset($_GET['actionType'])=='E') echo $newsDetails['news_date'] ?>">
<img src="../images/calender/calendar.gif" width="16" height="15" align="middle" style='font-size:11px' onClick="popUpCalendar(this, document.all.newsdate,'mm-dd-yyyy');"/>
</td>
</tr>
<tr>
<td colspan="2"><p> News Status <span class="ErrMessage"> <font color="#990000"> * :</font></span></p>
<input name="newsstatus" type="checkbox" id="newsstatus" <?php
if(isset($_GET['actionType']) && $_GET['actionType'] == 'E'){
if($newsDetails['news_status'] == 1){
echo " checked "; echo " value=1 ";
}
else {
echo "value=1";
}
}else {
echo "value=1";
}?>>
(Active/Deactive)</td>
</tr>
<tr align="center">
<td width="56" align="left">
<?php if(isset($_GET['actionType'])=='E') { ?>
<input name="update" type="submit" class="style4" value="update" onClick="return newsvalidation();">
<?php } else { ?>
<input name="Submit" type="submit" class="style4" onClick="return newsvalidation();" value="Submit"></td>
<td width="480" align="left"><input name="Submit2" type="reset" class="style4" value="Reset">
<?php } ?>
</td>
</tr>
<tr>
<td colspan="4" class="ErrMessage"><font color="#990000">* Are Mandatory</font></td>
</tr>
</table></td>
<td width="20" align="left" valign="top"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top" class="bottomtablebackbround"></td>
</tr>
<tr>
<td height="25" align="left" valign="bottom"> </td>
</tr>
<tr>
<td align="left" valign="top"> </td>
</tr>
</table>
</form>
</body>