I want to show the output after the text box not under it. Can this work?
<html>
<head>
<script type="text/javascript" src="hava.js"></script>
<script type="text/javascript">
function get() {
$.post('data.php', { name: form.name.value },
function(output) {
$('#age').html(output).show();
});
}
</script>
</head>
<body>
<p>
<form name="form">
<input type="text" name="name">
<br/>
<input type="button" value="Get" onClick="get();">
</form>
<div id="age"></div>
</p>
</body>
</html>
Here when I click the Get button if the $name is null it shows NULL. But null comes under the Get button i want it after the text box. So Like … [ text box ] Null
//data.php
<?php
$name = $_POST['name'];
if ($name == NULL) { echo "Null"; }
?>
Move the element your sticking the results in to above the
<br/>and set the display property to inline.Fiddle : http://jsfiddle.net/zqTLu/2/