0

我目前正在开发一个应用程序,但在 IE8 上遇到了困难。

我有以下代码:

<form class="fillClaimForm" name="fillClaimForm" method="POST" enctype="multipart/form-data" action="<?php print BASE_URL; ?>?action=insertBlogger" >
   <label for="fblogName">Blog's name: </label>
   <input type="text" name="fblogName" id="fblogName" class="cfInput" placeholder ="Complex" required />
   <label for="fblogUrl">URL: </label>
   <input type="text" name="fblogUrl" id="fblogUrl" class="cfInput" placeholder ="www.complex.com" required />
   <label>Blog's logo: </label>
   <div class="upload-file-container"><span>UPLOAD</span>
   <input  type="file" name="fblogLogo" id="fblogLogo"/>
   <p class="ErrLoad error" style="display:none;">Please load your logo</p>
   </div>
    <label for="fEmail">Email adresse: </label>
    <input  type="email" name="fEmail" id="fEmail" class="cfInput" required />
    <label for="frNum">Phone number: </label>
    <input  type="tel"  name="frNum" id="frNum" class="cfInput" required />
    <input type="hidden" name="idVid" id ="idVid" value=""/>
    <input type="hidden" name="idRubrique" id ="idRubrique" value=""/>
    <button id="sendClaim" class="sendClaim">SEND</button>

因此,我正在使用 jquery 进行表单提交:

......submit(function(){
        validate=false;
        formInfo = validateForm(validate,$thisLi);
        if(formInfo.validate){
            **fillClaimForm.submit();**
        }
        return false;
    });

它适用于除 IE8 以外的所有浏览器

有人可以帮助我。

谢谢

4

2 回答 2

1

尝试这个:

document.forms.fillClaimForm.submit();

或者,如果 ......您的代码中的 代表在同一​​个表单上创建提交处理程序,您可能只是说this.submit()

于 2013-04-12T09:52:45.483 回答
1

关闭您的表单。还要为您的表单提供与 id 相同的名称并使用

$("#formId").submit();

代码

<form class="fillClaimForm" name="fillClaimForm" method="POST" enctype="multipart/form-data" action="<?php print BASE_URL; ?>?action=insertBlogger" >
   <label for="fblogName">Blog's name: </label>
   <input type="text" name="fblogName" id="fblogName" class="cfInput" placeholder ="Complex" required />
   <label for="fblogUrl">URL: </label>
   <input type="text" name="fblogUrl" id="fblogUrl" class="cfInput" placeholder ="www.complex.com" required />
   <label>Blog's logo: </label>
   <div class="upload-file-container"><span>UPLOAD</span>
   <input  type="file" name="fblogLogo" id="fblogLogo"/>
   <p class="ErrLoad error" style="display:none;">Please load your logo</p>
   </div>
    <label for="fEmail">Email adresse: </label>
    <input  type="email" name="fEmail" id="fEmail" class="cfInput" required />
    <label for="frNum">Phone number: </label>
    <input  type="tel"  name="frNum" id="frNum" class="cfInput" required />
    <input type="hidden" name="idVid" id ="idVid" value=""/>
    <input type="hidden" name="idRubrique" id ="idRubrique" value=""/>
    <button id="sendClaim" class="sendClaim">SEND</button>
</form>

$("#sendClaim").click(function(){
        validate=false;
        formInfo = validateForm(validate,$thisLi);
        if(formInfo.validate){
            $("#fillClaimForm").submit();
        }
        return false;
    });
于 2013-04-12T09:52:48.403 回答