Archived

This topic is now archived and is closed to further replies.

  • 0

Desperately Seeking Code Help!

Question

Posted · Report post

I have a form on a page of my site that has three fields. I'd like all 3 fields to be required. I'd also like the form to submit to my email, so that I have a record of the names and e-mails, but also redirect the submitter to another page. I've gotten these last two pieces to work (submitting to my email and redirecting the submitter to a new page) but need help with what code to add to make the fields required. The code that is there presently (on www.elizabethlyons.com/bonus.html) is: <form action="http://www.bluehost.com/bluemail" enctype="multipart/form-data" method="POST"> <p> Name: <input name="name" type="text" /> Email: <input name="email" type="text" /> Amazon Order Number: <input name="ordernumber" type="text" /> <input name="redirect" value="http://www.elizabethlyons.com/bonus-downloads.html" type="hidden" /><font color="#ff3300">*Where can I find my Amazon.com order number? <input name="sendtoemail" value="elizabeth@elizabethlyons.com" type="hidden" /> <input value="Click to Get Bonus Gifts" type="submit" /> </p> </form> There are not words to express how grateful I will be to learn how to do this! Anyone know what code I'm missing? (I assume it's javascript, but I'm not sure where to place it or how it should read) THANK YOU! Liz

Share this post


Link to post
Share on other sites

2 answers to this question

Posted · Report post

Liz Forms have always been one of the most troublesome things to do. It appears you are using bluehost's own form. I did a quick search and I'm not sure their script allows required fields. There are countless form plugins available for WordPress which you might want to consider. Probably will end up happier. You can start at http://wordpress.org/extend/plugins/ and search for forms or contact forms. Contact Form 7 is one of the more popular but there are many good ones including cforms. Gravity Forms is getting a lot of heat right now - they are a premium (paid rather than free) option but appear to be a great choice if you need a lot of features: http://www.gravityforms.com/. Others may chime in with their favorites.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi, remove the code you've added, and back that up somewhere, I'm all for learning if you want to later. When working with WordPress it's usually best to play nice. So depending on what PageLines theme you're using you should already have a plugin called cforms which you can on-the-fly make forms to your hearts content very easily, then save it and post a very simple code tag where you want it to appear. If you don't have it get it here: http://www.deliciousdays.com/cforms-plugin/ Let me know if you need further help. Thanks, Bryan

Share this post


Link to post
Share on other sites