Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 提交表单后重新加载div_Php_Jquery - Fatal编程技术网

Php 提交表单后重新加载div

Php 提交表单后重新加载div,php,jquery,Php,Jquery,我有这样的代码。这实际上是一个表单。它允许用户更新他的评分。一旦他点击更新或保存。我做了一个ajax,保存了他的收视率,并给了他成功的信息。但是我如何刷新这个div来显示他的新评分,我需要在接下来的2分钟内阻止这个用户的更新/保存。我该怎么做?我使用jquery框架 $myresult.='' $myresult.=''; /*实际费率表-开始-实际费率/更新*/ $myresult.=''; /*自动启动*/ $myresult.=''; $myresult.=''; $myresult.=‘

我有这样的代码。这实际上是一个表单。它允许用户更新他的评分。一旦他点击更新或保存。我做了一个ajax,保存了他的收视率,并给了他成功的信息。但是我如何刷新这个div来显示他的新评分,我需要在接下来的2分钟内阻止这个用户的更新/保存。我该怎么做?我使用jquery框架

$myresult.=''

$myresult.='';
/*实际费率表-开始-实际费率/更新*/
$myresult.='';
/*自动启动*/
$myresult.='';
$myresult.='';
$myresult.=‘评级’;
$myresult.='';
$myresult.='';
$myresult.='';
/*终端*/
/*t车身-起动*/
$myresult.='';
未结算(一美元);
/*开始打印具有功能和评级的表格*/
对于($i=1;$i<$numproperty;$i++){
if($master_rating_properties['rating'.$i.'u name'])){
$myresult.='';
/*获取评级和评论-第一次将其设置为空*/
$indfeature=0;
$comment='';
$indfeature=$user_ratings['rating'.$i];
如果($indfeature==NULL){$indfeature=0;}
$comment=$user_ratings['rating'.$i.'u comment'];
$myresult.='';
$myresult.=$master_rating_properties['rating'.$i.'u name'.'。('$indfeature'.');
$myresult.='';
$myresult.='';
if(($userId!=“0”)&&(is_数组($user_评级)))
{
$tocheck=$indfeature;
}
其他的
{
$tocheck='0';
}
对于($k=0.5;$k';
}
/*对于k循环结束*/
$myresult.='';
$myresult.='';
$myresult.='';
$myresult.='';
$myresult.='';
}
/*结束if循环*/
}
/*循环i结束*/
$myresult.='';
/*结束t车身*/
/*页脚圆角起点*/
$myresult.='';
$myresult.='';
$myresult.='';
$myresult.='';
if(($userId!=“0”)&&(is_数组($user_评级)))
{
$myresult.='';
}
其他的
{
$myresult.='';
}
$myresult.='';
$myresult.='';
$myresult.='';
$myresult.='';
/*圆角桌端*/
$myresult.='';
/*结束表格以获取评分*/
$myresult.='';
/*结束第二个选项卡*/

使用,您可以返回JSON数据并使用更新组件数据。它只是和idea

您的意思是重建整个块并放置它吗?但这将创建重复的数据:(
$myresult .= '<form name =\'form1\' id=\'form1\' method = \'POST\' action=\''.$_SERVER['php_self'] .'\'>';


/* actual rating table - start - actual rate/update */

$myresult .= '<table id=\'rounded-corner\'>';

/* thead - start */
$myresult .= '<thead>';

$myresult .= '<tr>';

$myresult .= '<th width=\'30%\' class=\'rounded-company\' scope=\'col\'><span style=\'font: normal 18px  Arial, Helvetica, sans-serif; color:#FFF;\'>Ratings</span></th>';

$myresult .= '<th width=\'70%\' colspan=\'2\'class=\'rounded-q4\' scope=\'col\'></th>';

$myresult .= '</tr>';
$myresult .= '</thead>';

/* thead - end */

/* tbody - start */
$myresult .= '<tbody>';
unset($i);
/*start printing the table wth feature and ratings */
for ($i = 1 ; $i < $numProperties; $i++){

if($master_rating_properties['rating'.$i.'_name']){

$myresult .= '<tr>';

/*fetch ratings and comments - 1st make it to null */
$indfeature = 0;
$comment    = '';

$indfeature = $user_ratings['rating'.$i];
if($indfeature == NULL){ $indfeature = 0; }
$comment    = $user_ratings['rating'.$i.'_comment']; 


$myresult .= '<td width=\'22%\'>';

$myresult .= $master_rating_properties['rating'.$i.'_name'].' ( '.$indfeature.' )';

$myresult .= '</td>';

$myresult .= '<td colspan=\'0\' width=\'38%\' >';

if(($userId != '0') && (is_array($user_ratings)))
{
$tocheck = $indfeature;
}
else
{
$tocheck = '0';
}

for($k = 0.5; $k <= 10.0; $k+=0.5){

$tocheck = roundOff($tocheck);
if(($tocheck) == $k)
{ $chk = "checked"; }

else

{ $chk = ""; }

$myresult .= '<input class=\'star {split:2}\' type=\'radio\' name=\'rating'.$i.'\' id=\'rating'.$i.''.$k.'\' value=\''. $k .'\'  '.$chk.'  title=\''. $k.' out of 10 \' '.$disabled.' \' />';

}

/* for k loop end */
$myresult .= '</td>';
$myresult .= '<td width=\'40%\'>';
$myresult .= '<input title=\'Reason for this Rating.. \'type=\'text\' size=\'25\' name=\'comment'.$i.'\' id=\'comment'.$i.'\' style=\'display:;\' maxlength=\'255\' value="'.$comment.'">';
$myresult .= '</td>';
$myresult .= '</tr>';
}
/* end if loop */
}
/* end i for loop */

$myresult .= '</tbody>';
/* end tbody */    

/* footer round corner start */
$myresult .= '<tfoot>';
$myresult .= '<tr>';
$myresult .= '<td class=\'rounded-foot-left\'>&nbsp;</td>';

$myresult .= '<td class=\'rounded-foot-right\' colspan=\'4\' >';

if(($userId != '0') && (is_array($user_ratings)))
{
$myresult .= '<input type=\'button\' id=\'update_form\' value=\'Update\'>';
}
else
{
$myresult .= '<input type=\'button\' id=\'save_form\' value=\'Save\'>';
}

$myresult .= '</td>';
$myresult .= '</tr>';
$myresult .= '</tfoot>';

$myresult .= '</table>';
/*round corner table end */

$myresult .= '</form>';
/*end the form to take ratings */ 
$myresult .= '</div>';
/*end 2nd tab */