Yeah pretty simple with some reworking..
Obviously just change the textbox to a hidden form item when using in production
Code:
<body>
<script type="text/javascript" >
var backup = document.write;
var ipaddress = "";
document.write = function(str) {ipaddress += str;};
</script>
<script type="text/javascript" src="(nolinks)://l2.io/ip.js"> </script>
<script type="text/javascript" >
document.write = backup;
function setIP(){
document.getElementById('textBoxName').value = ipaddress;
}
window.onload = setIP;
</script>
<form id="formName" name="formName">
<input type="text" name="textBoxName" id="textBoxName" />
</form>
</body>