The invention relates to the technical field of Bootstrap, in particular to an implementation method of a dialog box capable of infinitely displaying hierarchies and directly submitting forms. The implementation method comprises the following steps of: 1, introducing required scripts and styles into a project and creating script tool classes; 2, creating a dialog box calling method; 3, acquiring acurrent object in the method body, defining a hierarchical index and initializing the hierarchical index; 4, judging whether a mode Id exists in the object or not, and if not, creating the mode Id; 5, defining buttons and events; 6, defining extension options; 7, calculating a hierarchical index and assembling button display content in the opening event; 8, destroying the object in the closing event; and 9, binding the extension options to the mode Id, and restoring the hierarchical index value. According to the method, the problems that webpage dialog boxes pop up to conflict with one another, cannot be repeatedly utilized and cannot directly submit the form are solved.