Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7910375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:50:49+00:00 2026-06-03T12:50:49+00:00

I had following script for comment system working nicely until I put parameters into

  • 0

I had following script for comment system working nicely until I put parameters into function call. Now instead of the function executing, it just reloads the page and bumps me up to the top. (Before, I had it not bumping and nicely inserting box.) Can anyone see error in following. Note, I gather that # is not preferred way to call functions from link, but other ways seemed rather complicated for this simple function call. Many thanks.

Note thispage is a text string ie “comments.php” while id and topicid are integers.

<script>
function showReplyBox(id,topicid,thispage) {
    var replybox = '<form action = "newcomment.php" method = "post"><input type="hidden" name="comid" value="';
replybox = replybox+ id + '">';
replybox = replybox + '<input type="hidden" name="topicid" value="';
replybox = replybox + topicid + '">';
replybox = replybox + '<input type="hidden" name="thispage" value="';
replybox = replybox + thispage + '">';
replybox = replybox + '<textarea autofocus placeholder="Reply to comment" id="replyarea" rows=1 cols=72></textarea><br><button>Reply</button></form>';
    var empty = ""; 

document.getElementById('replybox').innerHTML = replybox;
}
</script>
<body>
//link to call function
<a href="#" onclick="showReplyBox(44,142,'comments.php');return false">Reply</a

//box inserted here
<div id="replybox"></div>
</body>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T12:50:50+00:00Added an answer on June 3, 2026 at 12:50 pm

    Have the function return false at the end to prevent the browsers default behavior of following the anchor.

    Here is a working Fiddle: http://jsfiddle.net/VhYd8/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was using jquery 1.4.4.min the following script worked. $(:INPUT).change( function(){dataChanged=true; $(this).addClass(box2);}); I had
i've never had to do any cross scripting until now and i'm running into
I had the following in the <head> of a GSP <script type=text/javascript> $(button.remove-item).click(function() {
Say for example you had a shell script that utilises inotifywait in the following
I had the following injected into the footer of a site of mine and,
I had the following: <script type=text/javascript> var noteid = $('#noteid').val(); </script> <input type=hidden name=noteid
I had an issue where the following jquery script was failing in Rails 3.1
Edit: Originally I had a simple form Ajax script that wasn't working, turns out
So, say I had the following script: var hey = { foo: 1, bar:
In a script I had the following: $('#image-slider').empty(); Which emptied the image slider element

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.