We help IT Professionals succeed at work.
Get Started

Form Won't Submit With Javascript

256 Views
Last Modified: 2016-02-25
Hi,

I am trying to add the following code to Contact Form 7 on Wordpress:
<div class="form">
<div class="f-name">
    [text* your-name watermark "Name *"]
</div>

<div class="f-email">
    [email* your-email watermark "Email *"]
</div>

<div class="f-subject">
    [text your-subject watermark "Phone"]
</div>

<div class="f-message">
    [textarea* your-message watermark "Message *"]
</div>

<div class="f-captcha">

<div class="f-captcha-insert">
    [captchac captcha-886 size:l] 
</div>

<div class="f-captcha-CONFIRM">
    [text* captchar captcha-886 size:m watermark "Please enter the characters above."]
</div>

</div>

<div class="bt-contact">
     <a class="btn-color btn-color-1d" **href="javascript:;"**>[submit "SEND EMAIL"]</a>
</div>

</div>

Open in new window


When i click save, it get a 403 error notifying me that i do not have permission... however if i add just the normal default Contact Form 7, it ads fine.

I started removing the code from the above form until i found out what was causing the problem. The line below is causing the problem, but i am not sure why:

href="javascript:;"

Can anyone suggest what could be wrong? Thank you.
Comment
Watch Question
Developer
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2013
Commented:
This problem has been solved!
Unlock 2 Answers and 12 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE