<?php
	$addr = "";
	$dbname = "";
	$vcode = "";

	if (isset($data))
	{
		$bits = explode(':',$data);
		if (count($bits) > 3)
		{
			$addr = $bits[0];
			$dbname = $bits[1];
			$vcode = $bits[2];							
		}
	}
?>
<label style="display: inline;">Address : </label><a id="address" href="#" data-type="text" data-pk="drvname" data-placeholder="Enter Server Name" data-emptytext="Enter Server Name" data-value="<?php echo $addr; ?>" data-title="Enter Server Name" class="popupedit"><?php echo $addr; ?></a><br/>
<input id="val_address" name="address" type="hidden" value="<?php echo $addr; ?>"/>

<br/><br/>

<input type="submit" value="<?php if (isset($data)) echo "Save Changes"; else echo "Create Source";?>"/><br/>

<script>
function LoadA()
{
		$('#address').editable({
			 url: function(params) {
					var d = new $.Deferred;					
					$('#val_address').val(params.value);						
					return d.resolve();
			  }			
		});						
}
</script>
<!--<select name="type"><option>Discrete Input (Digital In) - 0xxxx</option><option>Coil (Digital Out) - 1xxxx</option><option>Input Register - 2xxxx</option><option>Output Register - 3xxxx</option><option>Register - 4xxxx</option></select>
<input name="address"/>-->