感谢百忙中回答我的问题,
祝你们工作顺利!
做了2个页面 第一个页面post表单提交 点击submit后跳转到第二个页面做信息确认;第二个页面是用上面的 innerHTM实现的 问题出来了!运行时候第一个页面点提交 第二个页面闪了一下 直接存到数据库里了,,,谁知道问题出在哪里咧!帮帮忙啊  

解决方案 »

  1.   

    </style></head>
    <script language="javascript">
    var chg=0;
    function change(){
    chg=1;
    }
    function check(){
    if(chg==1){
    testMessageBox();
    }else if(chg == 0){
    alert ("没有任何修改!");
    return false;
    }
    }
    //提交提示框
    var isIe=(document.all)?true:false;  
    //设置select的可见状态  
    function setSelectState(state)  
    {  
     var objl=document.getElementsByTagName('select');  
     for(var i=0;i<objl.length;i++)  
     {  
     objl[i].style.visibility=state;  
     }  

    //弹出方法  
    function showMessageBox(wTitle,content,wWidth)  
    {  
     closeWindow();  
     var bWidth=parseInt(document.documentElement.scrollWidth);  
     var bHeight=parseInt(document.documentElement.scrollHeight);  
     if(isIe){  
     setSelectState('hidden');}  
     var back=document.createElement("div");  
     back.id="back";  
     var styleStr="top:0px;left:0px;position:absolute;background:#666;width:"+bWidth+"px;height:"+bHeight+"px;";  
     styleStr+=(isIe)?"filter:alpha(opacity=40);":"opacity:0.40;";  
     back.style.cssText=styleStr;  
     document.body.appendChild(back);  
     var mesW=document.createElement("div");  
     mesW.id="mesWindow";  
     mesW.className="mesWindow";  
     mesW.innerHTML="<div class='mesWindowTop'><table width='100%' height='100%'><tr><td>"+wTitle+"</td></tr></table></div><div class='mesWindowContent' id='mesWindowContent'>"+content+"</div><table align='center' class='subput'><tr><td><input name='save' type='Submit' width:'50px' class='sub'  value='提交' ></td><td><input type='button' onclick='closeWindow();' title='关闭窗口' class='close' value='关闭' /></td></tr></table><div class='mesWindowBottom'></div>";  
     styleStr="left:50%;margin-left:-"+(wWidth/2)+"px;margin-top:-700px;position:absolute;width:"+wWidth+"px;";  
     mesW.style.cssText=styleStr;  
     document.body.appendChild(mesW);  
    }  
     function showBackground(obj,endInt)  
    {  
     obj.filters.alpha.opacity+=1;  
     if(obj.filters.alpha.opacity<endInt)  
     {  
     setTimeout(function(){showBackground(obj,endInt)},8);  
     }  
    }  
    //关闭窗口  
    function closeWindow()  
    {  
     if(document.getElementById('back')!=null)  
     {  
     document.getElementById('back').parentNode.removeChild(document.getElementById('back'));  
     }  
     if(document.getElementById('mesWindow')!=null)  
     {  
     document.getElementById('mesWindow').parentNode.removeChild(document.getElementById('mesWindow'));  
     }  
      
     if(isIe){  
     setSelectState('');}  
    }  
    //执行
    function testMessageBox()  
    {   
    messContent="<div style='padding:20px 0 20px 0;text-align:center'><p>*</p>..</div>";
     showMessageBox('温馨提示:请仔细浏览内容后提交',messContent,500);  
    } </script>
    ////////////////////////////////////////////////
    <form name='form1' action='history_save_manner.php' method='post' onSubmit="change()">
    <table width="90%"  border="0" align="center" ><tr>
        <td width="13%" height="0"   ></td>
        <td width="45%" ></td>
        <td width="13%"></td>
        <td width="29%" ></td>
      </tr>   
      <? 
    此为提交之前的验证 和部分html

    ?> 
     <tr><td height="40" colspan="4"  align="center"><br>
         <input name="save" type="submit"  id="btn"  value="下一步"  onclick="check();" > 
    <input name="close" type="reset"  value="重新输入"  id="btn">
       </td> </tr>
    </table>
    </form>
      

  2.   

    <form name='form1' action='history_save_manner.php' method='post' onSubmit="return change()">
    用 js 验证表单至少要这样
      

  3.   

    用button控制表单提交,防止刷新提交:<form name="form1" method="post">
    <input type="text" name="abc[]" value='' /><br>
    <input type="button" name="submit" value="submit" onclick="tosub()" />
    </form>
    <script>
    function tosub(){
    document.form1.action="xxx.php";
    document.form1.submit();
    }
    </script>
      

  4.   

    最好用onclick事件做处理,来的简单。有错误,就return false;
    或者不是这个问题,只能说明js有错误。
      

  5.   

    试过了 不用submit改成button 可以停留,但是就会提交不上$_POST数据 第二个弹出框也有个提交
    .innerHTML="<div class='mesWindowTop'><table width='100%' height='100%'><tr><td>"+wTitle+"</td></tr></table></div><div class='mesWindowContent' id='mesWindowContent'>"+content+"</div><table align='center' class='subput'><tr><td><input name='save' type='Submit' width:'50px' class='sub' value='提交' ></td><td><input type='button' onclick='closeWindow();' title='关闭窗口' class='close' value='关闭' /></td></tr></table><div class='mesWindowBottom'></div>"; 
    第二个为submit的话 提交上去是空的.....
      

  6.   

    ........我知道了
    感谢
    xuzuning
     
    (唠叨) 
    dmtnewtons
     
    (§轩辕枪神§) 
    mengxiangbaidu
     
    (修) 
    大概是4L的样子,