Is it possible to have an input text box such that when a person types something and presses submit or enter, I can trigger PHP to submit that data to a database without leaving the page (hence the JavaScript)?
+1
A:
Yes. It's possible. Here's an example of the sort of technique you want.
Kalium
2010-07-12 04:27:07
+7
A:
You're going to want to look into something called AJAX. I won't add any code here because there are thousands of excellent tutorials out there that will be much more thorough than I can type here. I would recommend using the jQuery Javascript library to help out.
Matthew J Morrison
2010-07-12 04:27:14
thanks this answered my question.
Matthew Carter
2010-07-12 04:41:08
Thanks again i just saw a tutorial on W3C and its kinda easy
Matthew Carter
2010-07-12 05:03:24
A:
You can do this by using a <form>
tag with you textbox and submit button inside.
<form name="input" action="do_something.php" method="get">
<input type="text" name="Value" />
<input type="submit" value="Submit" />
</form>
APShredder
2010-07-12 04:28:56
This isn't what he's asking for - he said, "without leaving the page".
Matthew J Morrison
2010-07-12 04:30:57
A:
Yes it is possible.
If you are just starting out I would suggest w3schools.com as an great place to learn all about web-technology.
AeroJoe
2010-07-12 04:30:21