heres a small script for getting the ip
<script>
/* There are a few instances in which the browser cannot ascertain the user's address, so we will instruct the browser to ignore errors by setting the onerror handler to null: */
window . onerror = null;
/* We will also give hostaddress and hostname a default value in case the address look-up fails: */
hostaddress = hostname = "(unknown)";
/* Now we will try to gather the host information: */
localhost = java . net . InetAddress . getLocalHost ();
hostaddress = localhost . getHostAddress ();
hostname = localhost . getHostName ();
/* The Java methods used above are capable of throwing exceptions. When Java exceptions occur within JavaScript, the script body is aborted. In order to make sure that the following statements get a chance to execute, we must include them in a separate script body: */
</script>
and this to show the ip
<script>
document . writeln ("<p>Your IP address is <b>" + hostaddress + "</b>.</p>");
</script>
however i don't know how you would put that into a hidden text field , something probably like <input name="hostip" type="hidden" value="document.write('hostaddress');" />
tho that does not work .