0

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.

Edited by mehrab: n/a

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by FlashCreations
0

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.

Edited by FlashCreations: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.