Ajax fill-in problems with forms

Source: Internet
Author: User
Tags button type

  • 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 &LT;/BUTTON&GT;&LT;/P&GT;&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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.