Jump to content

Archived

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

wizerm

Simple question I think....

Recommended Posts

I know this is a PHP forum but wasn't sure where else to turn for help. And since this forum helped out alot last time I figured someone may know what I am looking for hopefully. I am needing to know what I am missing to make this code for my submit button for my php contact form work. I just need to know if I am needing smoe javascript to make the following code work. Thanks for any help.

<a href="javascript:document.mailer.send.value='yes';document.mailer.submit();"><img src="images/send_btn.gif" alt="Send" name="SendBtn" border="0" /></a>

Share this post


Link to post
Share on other sites
what are you trying to do with it? it looks as though you're simply changing the value of the submit button and then submitting the form when someone clicks on the image... is that all you're after?

Share this post


Link to post
Share on other sites
Yes it is all I am after. I don't know alot about javascript so I didn't know if I was needing some extra javascript to make it work.

Share this post


Link to post
Share on other sites
you should be fine as long as the form you want submitted is named "mailer" and your submit button is named "send".

good luck!

Share this post


Link to post
Share on other sites
Here is what I have as far as code....

<form action="contacts.php" method="post" name="mailer">
<INPUT type="hidden" name="send" value="no">
              <div>
                <label for="sender_name">Your Name:</label>
              </div>
  <div class="contacts-form-input">
              <input type="text" name="sender_name" id="sender_name" onfocus="if(this.value=='Please enter a name'){this.value=''; this.style.color='#94969C';}"  value="" />
              </div>
  <div>
                <label for="sender_email">Your E-mail:</label>
              </div>
              <div class="contacts-form-input">
  <input type="text" name="sender_email" id="sender_email" onfocus="if(this.value=='Invalid email'){this.value=''; this.style.color='#94969C';}"  value="" />
              </div>
  <div>
                <label for="mail_body">Message Body:</label>
              </div>
  <div class="contacts-form-textarea">
  <textarea name="mail_body" rows="9" cols="16" id="mail_body"></textarea>
  </div>
              <div style="padding-top: 15px;"><a href="javascript:document.mailer.send.value='yes';document.mailer.submit();"><img src="images/send_btn.gif" alt="Send" name="SendBtn" border="0" /></a></div>
            </form>

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.