<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" language=javascript src="<?php echo base_url();?>myinclude/jquery.js">
</script>
<script type="text/javascript">
$(document).ready(function(){
$("form input:#toname").click(function(){
$.ajax({
type: "GET",
url: "
<?php echo base_url();?>index.php/ajax/index",
contentType: "application/json",
dataType: "json",
success: function(msg){
$("form input:#to").val(msg.name);
$("form input:#toname").val(msg.sex);
}
});
});
});
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Upload Form
</title>
</head>
<body>
<?php echo form_open_multipart('upload/do_upload');?>
<input type="text" name="to" id="to"/>
<input type="text" name="toname" id="toname"/>
</form>
</body>
</html>