- It's a form. Today's form is obtained EventID from the table with the event delegate, and the first one executes in the form with a GET request to get the JSON data from the background, but after adding an event, the function of modifying (filling the data into the form) fails, then various reasons are found, When the newly added deleted after he can be implemented, but after the addition of information, with the alert test, his field to get normal, but the display returned to JSON, can not be executed, the preliminary judgment is that the GET request is not sent out, as for the reason is still to be explored.
- The second is to display the value of the checkbook returned from JSON with a for loop output in checkbook form to the corresponding position, first, the value of the corresponding checkbook in the JSON is taken out, The reason this process is not completed is because it cannot get its value when the array is used to output it (only the list of all its values is available).
//1. Determine whether Target.value starts with modify or delete //2. If you start with modify, you can obtain the account //3. Handling of Modify cases varnode =Target.parentNode.parentNode; Strcode=Target.value; varFdstart = Strcode.indexof ("Modify"); varFbstart = Strcode.indexof ("delete"); varFlstart = Strcode.indexof ("Result"); varEvid = node.childnodes[2].innerhtml; if(Fdstart = = 0) { varUEM =NewXMLHttpRequest (); Uem.onload=function () { if(Uem.status = = 200) {Responseobject=Json.parse (Uem.responsetext); } varNewData = ""; NewData= "<form class=\" form-si\ "method=\" get\ ">" + ' <input type= "text" class= "Input-block-lev El "Value= ' + responseobject.events[0].marathon_name+ ' > ' + ' <input type=" text "class=" Inpu T-block-level "value= ' + responseobject.events[0].eventid+ ' > ' + ' <input type=" text "class=" Input-block-level "value= ' + responseobject.events[0].year+ ' > ' + ' <p><label><in Put 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>& Lt;a type=\ "reset\" href=\ "user_photographer_management_eg.html\" class=\ "btn btn-large btn-primary\" > Cancel </a > "+" <Button type=\ "submit\" class=\ "btn btn-large btn-primary\" value= ' ensure_ "+ evid +" ' > OK </BUTTON></P>&L T;/div> "+" </form> "; document.getElementById ("USEMF"). InnerHTML =newdata; alert (Uem.responsetext)}; Uem.open ("Get", "... /requests/myevent/modifyexistingeventbyeventcode.php?eventid= "+evid+" ",true); Uem.send (); }
Ajax fill-in problems with forms