I want to make a comment box in a web page which will take a comment from the user and save it to the database and show all comments including new comment without reloading by ajax or jscript.
Please help me someone with coding. Please.

The first step would be to get the server side of your request programmed. This will mean you would need knowledge in a language such as PHP, ASP, or JSP. If you already have a backend coded, the next step would be the javascript frontend. For this you will need to catch a form submit and send the data via AJAX instead. You can do this with the onsubmit="" attribute of the <form> .

<form action="comment_post.php" method="post" onsubmit="postComment();">
...
</form>
function postComment()
{
  //Validate the form here
  if(validate())
  {
    //Initiate AJAX
    //Get Vars
    //Attach POST and GET Vars
    //Send Request
    //Update on Reply
  }
  return(false);
}

For this you will need some basic understanding of AJAX. I would suggest AJAX on W3Schools. If you're using PHP, also look at PHP/AJAX on W3Schools.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.