Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-13-2012, 04:55 PM   PM User | #1
womackpb
New to the CF scene

 
Join Date: Jul 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
womackpb is an unknown quantity at this point
Unhappy Using a Button to link to a function

So I have a javascript contact form that slides onto my site. I want to put buttons elsewhere that make it come out.

My javascript is:

$(function (){
$('#contactAt').contactable({
recipient: 'pwomack@seitzservice.com',
subject: 'A Message from stylecrafthomesofrichmond.com'
});
});


And right now, I have the button code as....

<button type="button" onclick="function()">CLICK HERE</button>

I don't really know what to put for the onclick function.

Any help? Need any more info?
womackpb is offline   Reply With Quote
Old 07-13-2012, 06:45 PM   PM User | #2
marilynn.fowler
Regular Coder

 
Join Date: Aug 2002
Location: San Francisco
Posts: 442
Thanks: 19
Thanked 15 Times in 15 Posts
marilynn.fowler is an unknown quantity at this point
Instead of an anonymous function, give the function a name, like contactMe().

If you need it to slide out when the page loads, then use body onload="contactMe()"
__________________
Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read. Groucho Marx
marilynn.fowler is offline   Reply With Quote
Reply

Bookmarks

Tags
button, javascript, link

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:57 PM.


Advertisement
Log in to turn off these ads.