View Single Post
Old 05-15-2013, 03:03 PM  
Harvey Specter
Registered User
 
Harvey Specter's Avatar
 
Industry Role:
Join Date: Apr 2013
Posts: 13
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>
Harvey Specter is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote