Jump to content



Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
- - - - -

Add A Javascript Feedback Form On Your Web Page


7 replies to this topic

#1 karlosantana

    Advanced Member

  • Kontributors
  • PipPipPipPipPipPipPip
  • 145 posts
  • Gender:Male
  • Location:Wales(But I'm not a welsh farmer!)

Posted 31 December 2007 - 03:23 PM

So i was looking for a feedback form in javascript and i couldn't find one so ive made one for you guys here we go!
So this feedback form will ask for name, emails address and their comments
First of all add this code in between the <head> and </head> tags


&lt;script name="JavaScript">
<!-- 
function SendEmail()
{
		var toaddy = 'name@domain.com';
		var subject = 'JS Form Submission';
		var mailer = 'mailto:' + toaddy + '?subject=' + subject + '&body=' + 
'Name%20is\n\t' + document.jsform.visitorname.value + 
'\n\n' + 
'Email%20is\n\t' + document.jsform.email.value + 
'\n\n' + 
'Message:\n\n' + document.jsform.message.value +
'\n\n';
		parent.location = mailer;
} // -->
</script>

Thats the base of it if you havn't got that in it wont work

The next bit goes in between <body> and </body> tags in the position you want it
<form name="jsform">
<table><tr>
<td align="right">Name:</td>
<td><input name="visitorname" size="27"></td>
</tr><tr>
<td align="right">Email:</td>
<td><input name="email" size="27"></td>
</tr><tr>
<td colspan="2">
Your message:<br>
<textarea name="message" cols="31" rows="6" wrap="soft">
</textarea>
<center>
<p>
<input type="submit" onClick="SendEmail()" value="Send Message">
</center>
</td>
</tr></table>
</form>

And thats it thats all you need! you can customize colours etc.
Hope this helps

#2 Liam_CF

    Super Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 403 posts
  • Location:ERROR 404

Posted 01 January 2008 - 12:25 PM

Thanks a lot for this, will use on my website.

Edited by Liam_CF, 01 January 2008 - 12:25 PM.


#3 MiniK

    Advanced Member

  • Kontributors
  • PipPipPipPipPipPipPip
  • 112 posts
  • Gender:Male
  • Location:United Kingdom

Posted 01 January 2008 - 02:05 PM

Hang on, doesn't this just open an email window with the preloaded content?

#4 Liam_CF

    Super Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 403 posts
  • Location:ERROR 404

Posted 01 January 2008 - 02:20 PM

I would have thought it was a send email online form type thing.

#5 karlosantana

    Advanced Member

  • Kontributors
  • PipPipPipPipPipPipPip
  • 145 posts
  • Gender:Male
  • Location:Wales(But I'm not a welsh farmer!)

Posted 09 January 2008 - 02:45 PM

Yep it does it sends the whole form to the email address you put in it doesn't open up any other screens programs or whatever! its really good actually i use it myself! enjoy using it! im glad it has helped people!

#6 GaiaZone

    Newbie [Level 2]

  • Kontributors
  • PipPip
  • 25 posts
  • Gender:Male
  • Location:PR

Posted 09 January 2008 - 11:15 PM

Oh, this is great.

It's far shorter than the PHP script I did for sending feedbacks, and it doesn't take two different pages.

Thanks for this, the only thing I'd have to add is a security feature to avoid bulk spams. =]

#7 hitmanblood

    Privileged Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 788 posts
  • Gender:Male
  • Location:mreža

Posted 09 January 2008 - 11:26 PM

Well, javascripts are nice however I have found out and this is not the big secret they are making your site run slower that is in some cases when there is real exess of the javascript usage on the page then it is running slowly and may even slower your browser even on the strongest computers. I do not have anything against your script I am certian that is it working all right however there is problem with javascript and I don't like it.

P.S. I will stick to the php. :)

#8 feedbackform

    Newbie

  • Kontributors
  • Pip
  • 1 posts

Posted 03 June 2010 - 06:52 PM

I could recommend another powerful but commercial solution.

The service provides an easy integration (1 line of html code) of instant cross-browser JavaScript customer Feedback Form and Feedback Analytics to websites: http://userthought.com
Tested on IE6, IE7, IE8, FireFox, Safari and Chrome...

It could help you to get better communication with your users.




Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users