Click to See Complete Forum and Search --> : FORM and DIV button submit issue?


Barton68
08-28-2008, 06:07 AM
Hi,
Requirement:
I need to submit a client email address to a hidden field in a contact webpage. I don't want to add the address to the URL.

Currently I have the following acting as a button (which works fine):

<p class="contact-text">
<a onmouseover="window.status='Contact Owners Direct...'; return true;" onmouseout="window.status=''; return true;" title="Contact Owners Direct" onclick="window.open(this.href,''); return false;" href="contact.php?client=info[-at-]maio.com&amp;accid=1">
Contact Owners Direct</a>
</p>

My issue is that if I replace the <a> with an INPUT type="image" and use an image, the submit works, but is there a method so that I can still use a link to submit?

<form action="contact.php?accid=1" method="post" name="accommodationcontactform"><p>
<input type="hidden" id="client" name="client" value="info[-at-]maio.com"/>
<p class="contact-text"><input type="image" src="" border="0" name="submit" alt="Contact"/>Contact Owners Direct</p>
</p></form>

Thanks,

Barton.

ray326
08-28-2008, 11:14 PM
Something like so:

<a href="#" onclick="this.form.submit()">Contact Owner</a>

Barton68
08-29-2008, 03:19 AM
Thanks, but didn't work...

ANy other thoughts?

Thanks,

Barton.

ray326
08-29-2008, 10:24 PM
Nope. Something like that should work. Maybe you need to ask in the Javascript forum.

Barton68
08-31-2008, 11:21 AM
Hi,

sorry, it does work, but doesn't recreate the 'submit' behavior, i.e. I don't get the hidden fields within the FORM tags.

Thank you again,

Barton.