I'm trying to implement IP address validation on my page.
- I have a test box displaying my current IP address
- A hidden variable having the same
I have two buttons Save & the other Revert, On Save the new IP address is written to the DB; on Revert, I need to restore the old IP address from the hidden variable to the visible box.
I'm using the plugin available @ http://mlntn.com/2009/12/30/jquery-ip-address-plugin/
to do my validation.
Here is the
$(function(){
$('#ipAddress').ipaddress();
});
(function() {
$('#cancel')
.button()
.click(function() {
$("#ipAddress").text($("#oldIPAddress").text());
});
This work fine, but my text box ipAddress does not reflect the data until page is refreshed :(
<s:textfield name="ipAddress[abcd][]" id="ipAddress" cssClass="text ui-widget-content ui-corner-all" label="IP Address" value="%{ipAddress}"/>
<s:hidden name="resIpadd" id="resIpadd" value="%{ipAddress}"/>
Is there a way to get the data to be reflected without refreshing the page?