//1.判断target.value是以modify开头的还是delete开头的
//2.若以modify开头,则可以获得account
//3. 处理modify的情形
var node = target.parentNode.parentNode;
strCode = target.value;
var fdStart = strCode.indexOf("modify");
var fbStart = strCode.indexOf("delete");
var flStart = strCode.indexOf("result");
var evId = node.childNodes[2].innerHTML;
if (fdStart === 0) {
var uem = new XMLHttpRequest();
uem.onload = function () {
if (uem.status === 200) {
responseObject = JSON.parse(uem.responseText);
}
var newData = "";
newData = "<form class=\"form-si\" method=\"get\">"
+ '<input type="text" class="input-block-level" value=' + responseObject.events[0].marathon_name+ '>'
+ '<input type="text" class="input-block-level" value=' + responseObject.events[0].eventId+ '>'
+ '<input type="text" class="input-block-level" value=' + responseObject.events[0].year+ '>'
+ '<p><label><input type="checkbox" name="allow" value = '+ responseObject.events[0].allow_photographer+' >'+responseObject.events[1].allow_photographer+'</label></p>'
+ '<input type="text" class="input-block-level" value=' + responseObject.events[0].bib_format + '>'
+ "<div align=\"center\"><p><a type=\"reset\" href=\"user_photographer_management_eg.html\" class=\"btn btn-large btn-primary\">取消</a> " +
"<button type=\"submit\" class=\"btn btn-large btn-primary\" value='ensure_" + evId + "' >确定</button></p></div>"
+ "</form>";
document.getElementById("usemf").innerHTML = newData; alert(uem.responseText)
};
uem.open("get", "../requests/myEvent/modifyExistingEventByEventCode.php?eventId="+evId+"", true);
uem.send();
}