<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
function validate_field(){
value = $("#textfield_id").val();
if(value == ''){
alert("Please enter something in the field");
return false;
}
$.post("your_php_page.asp", { value: ""+value+"", another_variable: "testing" },
function(data){
//data is the output of your_php_page.php after it runs
alert("Here is the data returned: " + data);
//you could also write the data on the page too
$("#response").html(data);
});
}
</script>
<div id="response"></div>
<input type="text" name="texfiled_name" id="texfield_id"> <input type="button" onClick="validate_field()" value="Check Field">
|