Jump to content


Photo

Simple question I think....


  • Please log in to reply
4 replies to this topic

#1 wizerm

wizerm
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 30 August 2006 - 07:21 PM

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>

#2 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 30 August 2006 - 07:45 PM

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?

You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#3 wizerm

wizerm
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 30 August 2006 - 07:50 PM

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.

#4 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 30 August 2006 - 07:51 PM

you should be fine as long as the form you want submitted is named "mailer" and your submit button is named "send".

good luck!
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#5 wizerm

wizerm
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 30 August 2006 - 07:52 PM

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>




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users