<form onSubmit="return edit_validation(this);" action="<?php echo base_url($this->router->fetch_class()."/update")?>" method="POST" style="padding-left: 5px; padding-right: 5px;">
	<!--  -->
	<input type="hidden" name="HOST" value="<?php if(isset($data)) echo $data->HOST;?>">
	<!--  -->
	<div class="form-group">
		<label>Name</label>
		<input type="text" name="NAME" value="<?php if(isset($data)) echo $data->NAME;?>" maxlength="200" class="form-control" autocomplete="OFF">
	</div>
	<div class="form-group">
		<label>E-Mail Address</label>
		<input type="text" name="EMAIL" value="<?php if(isset($data)) echo $data->EMAIL;?>" maxlength="200" class="form-control" autocomplete="OFF">
	</div>
	<div class="form-group">
		<label>Password</label>
		<input type="password" name="PASSWORD" value="<?php if(isset($data)) echo $data->PASSWORD;?>" maxlength="50" class="form-control" autocomplete="OFF">
	</div>
<!--	<div class="form-group">-->
<!--		<label>Host</label>-->
<!--		<input type="text" name="HOST" value="<?php if(isset($data)) echo $data->HOST;?>" maxlength="200" class="form-control" autocomplete="OFF">-->
<!--	</div>-->
	<div class="form-group">
		<label>Port</label>
		<input type="text" name="PORT" value="<?php if(isset($data)) echo $data->PORT;?>" maxlength="11" class="form-control" autocomplete="OFF">
	</div>
	<div class="form-group" style="margin-top: 30px;">
		<label></label>
		<button type="submit" id="edit_btn_submit" class="btn btn-primary btn-xs-block btn_submit">
			<i class="fa fa-save"></i>
			Save
		</button>
	</div>
</form>

<script>
	$(document).ready(function(){
//		$("#edit_ajax_container .select2").select2();
	});

	function edit_validation(form){
		var error = "";
		
		$(form).find("[required]").each(function(){
			if($(this).val() == ""){
				if(error != "") error += "<br>";
				switch($(this).attr("name")){
					case "NAME":
						error += "Please fill in the Name!";
						break;
					default:
						error += "Please complete the Form!";
						break;
				}
				
				return false;
			}
		});

		if(error == ""){
			disable_btn(".btn_submit");
		}
		else{
			prompt_error(error);
			return false;
		}
	}
</script>