1

I am currently editing a script I had made for me some time back. I no longer have contacts for the original coder due to no longer using Yahoo messenger.

On my contact form it uses the onclick="$('#contact-form').submit()" function.

I am trying to get the contact form the submit but when I complete the form and click "Apply" it will not submit, My guess is down to the Javascript validating some of the fields that I have changed or deleted. Is there a way I can get round this? I have removed the onclick function however it will not submit when I try to complete the form.

Here is my form heading:

            <div id="contact-form" class="box1 form css3" xmlns:pageScript="urn:pageScript">
                <a name="loanform"></a>
                <form action="thankyou.php" method="post" id="contact-form">
                    <fieldset class="loan">
                                <legend><span>1 - Your Details</span></legend>
                                                    <ol class="group" data-role="listview">
                            <li class="clearfix" id="ValItem">
                                <label for="Val" id="ValCheck">Amount</label>

And for the bottom of the form as the form has a fair few fields...

    <fieldset class="submit" style="height:0;overflow:hidden">
                        <ol class="group" data-role="none">
                            <li></li>
                        </ol>
                    </fieldset>

                    <div id="warning-box">
                        <p>By pressing the APPLY button below you agree to our Terms and Conditions.</p>
                    </div>
                    <div class="full-width clearfix">
                        <div id="previousButton" class="prev-button"><img class="full-width prev-desktop" src="back-button.png" border="0"/><img class="full-width prev-mobile" src="back-button.png" border="0"/></div>
                        <div id="nextButton" class="next-button"><img class="full-width next-desktop" src="next-button.png" border="0"/><img class="full-width next-mobile" src="next-button.png" border="0"/></div>
                        <div id="SendEnquiry" name="SendEnquiry" onclick="$('#contact-form').submit()" class="apply-button"><img class="full-width apply-desktop" src="apply-button.png" border="0"/><img class="full-width apply-mobile" src="apply-button.png" border="0"/></div>
                    </div>
                </form>
                <button id="popButton" style="display:none">x</button>
            </div>

I do not get any error messaged displayed, When you click the Apply button it does not seem to do anything. I have no objection as to how the form can be submit, I am really just looking for a way round it to make sure clients are able to submit there request.

12
  • Hi A Wolff, How can i edit this? Thanks Commented Jan 2, 2015 at 17:29
  • Done that now, Sorry Wolff Commented Jan 2, 2015 at 17:33
  • No error in console? Are you including jQuery? Commented Jan 2, 2015 at 17:40
  • As i am new to coding i dont know if jquery is being included, i know the validating script that is being called is called: complete.js my guess is this script is causing the form not to send as if i remove this script the form does not operate properly. i was not sure if there was a simple way round this that i could attach to the form in html that would bypass any validation taking place and execute the POST to Action without calling the script to validate on submit Commented Jan 2, 2015 at 17:48
  • Just seen this in console: no element found d29a:1 Use of getPreventDefault() is deprecated. Use defaultPrevented instead. jquery.min.js:3 Commented Jan 2, 2015 at 17:49

1 Answer 1

1

As you said "I have no objection as to how the form can be submit, I am really just looking for a way round it to make sure clients are able to submit there request.", You can also sumbit as below.

Just write this line above </form> tag.

<input type="submit" value="SUBMIT"/>

This line will add new button in your page. You can replace it with your old button's css.

This way is very simple and you do not need to include jquery in your html page.

Sign up to request clarification or add additional context in comments.

1 Comment

Hi user3134634, i would use this command and i have tried this. The only reason this will not work is due to the form being a process form (This is all designed to run on 1 page) However the user has to fill in selected details then click Next.. Fill in more information.. Click next again then at final stage the (Next Button) switches to (Apply Button)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.