PHP Javascript variable help
<p>Is there any way I could get the value of a html text field without using GET or POST or REQUEST? Alternatively, is there any way to get the field value in the same form or page else where.</p>

<p>This works with direct value such as "james", "system" and so on. the only problem is how do i make it work with html  field values</p>

<p>Like:</p>

<pre><code>&lt;input type = "submit" onclick = "
&lt;?php $username = "kut"; 
$result = checkname($username); 
if($result) 
{
?&gt; alert("success"); &lt;?php 
} 
else {?&gt; alert("failed"); &lt;?php 
}?&gt; 
"&gt;
</code></pre>

<p>How can i replace "kut" with the value of a text field with id = "username" ?</p>

<pre><code>&lt;?php $username = "?&gt;document.getElementById('username').value;&lt;?php"?&gt;
</code></pre>

<p>or something like that...???</p>

<p>In short, I need to get the value of a html field else where in the same page inside a javascript function, using PHP... like in the above javascriptFunction(), function</p>
