-1

this is the form:

<form action="#" method="post">
<input type="submit" name="saveit" id = "submit" value = "Save" /><br /><br />
<input type="reset" name="reset" value = "Clean" />
<textarea name="comments" dir="rtl"></textarea>
</form>

i want to save the textarea value in my database without refresh the page, how can i do that?

SQL QUERY:

UPDATE dashboard SET textarea='$comments' WHERE id=1

thank you everybody ! :)

Niv_H
  • 61
  • 1
  • 7

1 Answers1

0

My Script to call ajax

<script language="javascript">
function save_data(value)
{
            $.ajax({
               type: "GET",
               url: "sample.php",
               data: {'comments' : value},
               dataType: "text",
               success: function(msg){
                           //Receiving the result of search here
               }
            });
}
</script>