简体   繁体   中英

formname.submit not working on IE8

I am currently developing an app and i am getting difficulties on IE8.

I have the following code:

<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>

Consequently, I am doing a form submission using jquery:

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

It is working on all browsers except IE8

Can someone kindly help me.

Thanks

Try this:

document.forms.fillClaimForm.submit();

Or if the ...... in your code represents creating of a submit handler on that same form you can probably just say this.submit() .

Close your form. Also give the same name as the id for your form and use

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

Code

<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;
    });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM