Created
November 30, 2016 04:42
-
-
Save agentready/7980fbd1eb83970b37917ba5b71eb63e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>jquery</title> | |
<script src="http://cdn.dev/jq/jquery.min.js"></script> | |
</head> | |
<body> | |
<form id="myform"> | |
<input type="submit" value="Save This"> | |
</form> | |
<script type="text/javascript"> | |
var data = [{"id":"52","name":"hayat","email":"hayat.hasan@gmail","password":"123","reg_date":"29-11-16 09:22:22","businesstype":"","phone":"01710","address":"224 B","ward":"ba","village":"bhh","upozilla":"bahhff","district":"dhffvh"}]; | |
$.each(data, function(i, f) { | |
$.each(f, function(id, val){ | |
var toin = setHtml(id,val); | |
$('#myform').append(toin); | |
}); | |
}); | |
function setHtml(id,val){ | |
var toin = ''; | |
switch(id){ | |
case "name": | |
toin = '<input type="text" id="'+id+'" value="'+val+'">'; | |
break; | |
case "reg_date": | |
toin = '<input type="date" id="'+id+'" value="'+val+'">'; | |
break; | |
case 'email': | |
toin = '<input type="email" id="'+id+'" value="'+val+'">'; | |
break; | |
default: | |
toin = '<input type="text" id="'+id+'" value="'+val+'">'; | |
break; | |
} | |
return toin; | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pls I want to build a social network with lavarel socialite I need help, any attention at all I will be glad