Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Hey so ive been working with couch about 3 years now and im pretty familiar with everything but for some reason i cannot figure this out.

if i bring in a DBF to EDIT or CREATE using an ajax call it will not save after submitting.



they are both loaded at the same time but one works the other does not. im going a bit crazy :?:

Code: Select all
<!--New Step Modal-->

            <div class="modal fade dialogbox" id="steps_modal" data-bs-backdrop="static" tabindex="-1" role="dialog">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h2 class="modal-title">
                                <cms:show k_page_title />
                            </h2>
                        </div>
                        <div class="modal-body">
                            <cms:form masterpage="rnd/steps.php" mode='create' enctype="multipart/form-data" method='post' anchor='0' name="kformname6">
                                <cms:if k_success>
                                    <cms:db_persist_form _invalidate_cache='0' _auto_title='1' />
                                    <cms:if k_success>
                                        <cms:set_flash name='success_msg' value='1' />
                                        <cms:redirect "researchcenter.php" />
                                    </cms:if>
                                </cms:if>
                                <cms:if k_error>
                                    <font color='red'>
                                        <cms:each k_error>
                                            <cms:show item /><br />
                                        </cms:each>
                                    </font>
                                </cms:if>
                                <div class="form-group basic animated">
                                    <div class="input-wrapper">
                                        <cms:input name='action' type='bound' class="form-control" placeholder="Customer Name" autocomplete="off" />
                                        <i class="clear-input">
                                            <ion-icon name="close-circle"></ion-icon>
                                        </i>
                                    </div>
                                </div>

                                <div class="form-group basic animated" id="vc">
                                    <div class="input-wrapper">
                                        <cms:input name='valve_change' type='bound' class="form-control" placeholder="Shop Name" autocomplete="off" />
                                        <i class="clear-input">
                                            <ion-icon name="close-circle"></ion-icon>
                                        </i>
                                    </div>
                                </div>
                                <div>
                                </div>
                                <div class="form-group basic animated" id="td">
                                    <div class="input-wrapper">
                                        <cms:input name='test_drive' type='bound' class="form-control" />
                                        <i class="clear-input">
                                            <ion-icon name="close-circle"></ion-icon>
                                        </i>
                                    </div>
                                </div>
                                <div>
                                </div>
                                <div class="form-group basic animated" id="sc">
                                    <div class="input-wrapper">
                                        <cms:input name='spring_change' type='bound' class="form-control" />
                                        <i class="clear-input">
                                            <ion-icon name="close-circle"></ion-icon>
                                        </i>
                                    </div>
                                </div>
                                <div class="form-group basic animated" id="pm">
                                    <div class="input-wrapper">
                                        <cms:input name='plate_mod' type='bound' class="form-control" />
                                        <i class="clear-input">
                                            <ion-icon name="close-circle"></ion-icon>
                                        </i>
                                    </div>
                                </div>
                                <div class="form-group basic animated" id="ht">
                                    <div class="input-wrapper">
                                        <cms:input name='hydratest' type='bound' class="form-control" />
                                        <i class="clear-input">
                                            <ion-icon name="close-circle"></ion-icon>
                                        </i>
                                    </div>
                                </div>

                        </div>
                        <div class="modal-footer">
                            <div class="btn-inline">
                                <a href="#" class="btn btn-text-secondary" data-bs-dismiss="modal">CLOSE</a>
                                <button type="submit" class=" btn btn-text-primary shadowed ld-ext-right" onClick="this.classList.toggle('running')">Save<div class="ld ld-ring ld-spin">
                                    </div></button>
                            </div>
                        </div>
                        </cms:form>
                    </div>
                </div>
            </div>
<!--New Step Modal-->


<!--Edit Project Modal-->

            <div class="modal fade dialogbox" id="edit_project" data-bs-backdrop="static" tabindex="-1" role="dialog">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h2 class="modal-title">
                                <cms:show k_page_title />
                            </h2>
                        </div>
                        <div class="modal-body">
                            <cms:form masterpage="rnd/projects.php" mode='edit' page_id="<cms:show project_id/>" enctype="multipart/form-data" method='post' anchor='0' name="kformname5">
                                <cms:if k_success>
                                    <cms:db_persist_form />
                                    <cms:if k_success>
                                        <cms:set_flash name='success_msg' value='1' />
                                        <cms:redirect "researchcenter.php" />
                                    </cms:if>
                                </cms:if>
                                <cms:if k_error>
                                    <font color='red'>
                                        <cms:each k_error>
                                            <cms:show item /><br />
                                        </cms:each>
                                    </font>
                                </cms:if>
                                <div class="form-group basic animated">
                                    <div class="input-wrapper">
                                        <cms:input name='k_page_title' type='bound' class="form-control" placeholder="Project Name" autocomplete="off" />
                                        <i class="clear-input">
                                            <ion-icon name="close-circle"></ion-icon>
                                        </i>
                                    </div>
                                </div>

                                <div class="form-group basic animated" >
                                    <div class="input-wrapper">
                                        <cms:input name='related_trans_2' type='bound' class="form-control" placeholder="Shop Name" autocomplete="off" />
                                        <i class="clear-input">
                                            <ion-icon name="close-circle"></ion-icon>
                                        </i>
                                    </div>
                                </div>
                                <br>
                               <h6>Baseline Data</h6>
                                <hr>
                                <div class="form-group basic animated">
                                    <div class="input-wrapper">
                                        <cms:input name='line_d_idle' type='bound' class="form-control" placeholder="Line pressure drive @ idle"/>
                                        <i class="clear-input">
                                            <ion-icon name="close-circle"></ion-icon>
                                        </i>
                                    </div>
                                </div>
                                <div>
                                </div>
                                <div class="form-group basic animated" >
                                    <div class="input-wrapper">
                                        <cms:input name='line_d_stall' type='bound' class="form-control" placeholder="Line pressure drive @ stall"/>
                                        <i class="clear-input">
                                            <ion-icon name="close-circle"></ion-icon>
                                        </i>
                                    </div>
                                </div>
                                <div class="form-group basic animated" >
                                    <div class="input-wrapper">
                                        <cms:input name='line_r_idle' type='bound' class="form-control" placeholder="Line pressure reverse @ idle"/>
                                        <i class="clear-input">
                                            <ion-icon name="close-circle"></ion-icon>
                                        </i>
                                    </div>
                                </div>
                                <div class="form-group basic animated" >
                                    <div class="input-wrapper">
                                        <cms:input name='line_r_stall' type='bound' class="form-control" placeholder="Line pressure reverse @ stall"/>
                                        <i class="clear-input">
                                            <ion-icon name="close-circle"></ion-icon>
                                        </i>
                                    </div>
                                </div>
                                <div class="form-group basic animated" >
                                    <div class="input-wrapper">
                                        <cms:input name='epc_min' type='bound' class="form-control" placeholder="EPC min"/>
                                        <i class="clear-input">
                                            <ion-icon name="close-circle"></ion-icon>
                                        </i>
                                    </div>
                                </div>
                                <div class="form-group basic animated" >
                                    <div class="input-wrapper">
                                        <cms:input name='epc_max' type='bound' class="form-control" placeholder="EPC Max"/>
                                        <i class="clear-input">
                                            <ion-icon name="close-circle"></ion-icon>
                                        </i>
                                    </div>
                                </div>
                        </div>
                        <div class="modal-footer">
                            <div class="btn-inline">
                                <a href="#" class="btn btn-text-secondary" data-bs-dismiss="modal">CLOSE</a>
                                <button type="submit" class=" btn btn-text-primary shadowed ld-ext-right" onClick="this.classList.toggle('running')">Save<div class="ld ld-ring ld-spin">
                                    </div></button>
                            </div>
                        </div>
                        </cms:form>
                    </div>
                </div>
            </div>

<!--Edit Project Modal-->
Hi,

I don't think it'd be possible for us to recreate the condition using the code you posted (certainly not without expending considerable effort in filling in the gaps).

It'd be much more helpful if you could create a mini version of the issue with just enough data to demonstrate the problem - e.g. use a separate template with just one editable region and place within it all the front-end code so that we can simply register the template on our machine and get to see the problem.

Can you do that please?
****EDIT****
This is a single page project and everything is loaded in using ajax.
i have 3 templates 1 is the main page called the researchcenter.php which is the main page.
2. i have projects.php that saves each project and its data
3. i have steps that relates to each project and saves the project steps

****EDIT****







i have multiple forms on one page,


my research center has only 1 form to start and a drop down menu that shows what project to select.
Code: Select all
 

<select id="s_project" class="form-select" placeholder="Select Project">
                            <option selected disabled>Select Project</option>
                                <cms:pages masterpage="rnd/projects.php">
                                    <option value="<cms:show k_page_id/>"><cms:show k_page_title/></option>
                                </cms:pages>
                            </select>     



<cms:form masterpage="rnd/valves.php" mode='create' enctype="multipart/form-data" method='post' anchor='0' name='kformname1' >
                                <cms:if k_success>
                                    <cms:db_persist_form _invalidate_cache='0' _auto_title='1' />
                                    <cms:if k_success>
                                        <cms:set_flash name='success_msg' value='1' />
                                        <cms:redirect "researchcenter.php" />
                                    </cms:if>
                                </cms:if>
                                <cms:if k_error>
                                    <font color='red'>
                                        <cms:each k_error>
                                            <cms:show item /><br />
                                        </cms:each>
                                    </font>
                                </cms:if>
                                <div class="form-group basic animated">
                                    <div class="input-wrapper">
                                        <cms:input name='related_project' type='bound' class="form-select" autocomplete="off" />
                                    </div>
                                </div>
                                <div class="form-group basic animated">
                                    <div class="input-wrapper">
                                        <cms:input name='valve_type' type='bound' class="form-control" autocomplete="off" />
                                        <i class="clear-input">
                                            <ion-icon name="close-circle"></ion-icon>
                                        </i>
                                    </div>
                                </div>
                   
                                <button type="submit" class=" btn btn-text-primary shadowed ld-ext-right" onClick="this.classList.toggle('running')">Save<div class="ld ld-ring ld-spin">
                                    </div></button>
                               
                        </cms:form>


when i select the project im working through ajax. i also bring in 2 forms one that creates a new "step" and one that edits the original projects information both as modals

Code: Select all
<cms:form masterpage="rnd/steps.php" mode='create' enctype="multipart/form-data" method='post' anchor='0' name="kformname6">
                                <cms:if k_success>
                                    <cms:db_persist_form _invalidate_cache='0' _auto_title='1' />
                                    <cms:if k_success>
                                        <cms:set_flash name='success_msg' value='1' />
                                        <cms:redirect "researchcenter.php" />
                                    </cms:if>
                                </cms:if>
                                <cms:if k_error>
                                    <font color='red'>
                                        <cms:each k_error>
                                            <cms:show item /><br />
                                        </cms:each>
                                    </font>
                                </cms:if>
                                <div class="form-group basic animated">
                                    <div class="input-wrapper">
                                        <cms:input name='action' type='bound' class="form-control" placeholder="Customer Name" autocomplete="off" />
                                        <i class="clear-input">
                                            <ion-icon name="close-circle"></ion-icon>
                                        </i>
                                    </div>
                                </div>

                                <div class="form-group basic animated" id="vc">
                                    <div class="input-wrapper">
                                        <cms:input name='valve_change' type='bound' class="form-control" placeholder="Shop Name" autocomplete="off" />
                                        <i class="clear-input">
                                            <ion-icon name="close-circle"></ion-icon>
                                        </i>
                                    </div>

                        </div>
                        <div class="modal-footer">
                            <div class="btn-inline">
                                <a href="#" class="btn btn-text-secondary" data-bs-dismiss="modal">CLOSE</a>
                                <button type="submit" class=" btn btn-text-primary shadowed ld-ext-right" onClick="this.classList.toggle('running')">Save<div class="ld ld-ring ld-spin">
                                    </div></button>
                            </div>
                        </div>
                        </cms:form>


<cms:form id="edit_project" masterpage="rnd/projects.php" mode='edit' page_id="<cms:show project_id/>" enctype="multipart/form-data" method='post' anchor='0' name="kformname5">
                           
                                <cms:if k_success>
                                   
                                    <cms:db_persist_form 
                                    _invalidate_cache='0'
                                   
                                    />
                                   
                                    <cms:if k_success>
                                        <cms:set_flash name='success_msg' value='1' />
                                        <cms:redirect "researchcenter.php" />
                                       
                                    </cms:if>
                                </cms:if>
                                <cms:if k_error>
                                    <font color='red'>
                                        <cms:each k_error>
                                            <cms:show item /><br />
                                        </cms:each>
                                    </font>
                                </cms:if>
                                 <cms:hide></cms:hide>

                                <div class="form-group basic animated">
                                    <div class="input-wrapper">
                                        <cms:input name='k_page_title' type='bound' class="form-control" placeholder="Project Name" autocomplete="off" />
                                        <i class="clear-input">
                                            <ion-icon name="close-circle"></ion-icon>
                                        </i>
                                    </div>
                                </div>

                                 <button type="submit" class=" btn btn-text-primary shadowed ld-ext-right" onClick="this.classList.toggle('running')">Save<div class="ld ld-ring ld-spin">
                                    </div></button>
                                </cms:form>




Now when i submit either forms that came from the Ajax neither work. i understnd the problem has to do with the fact that im trying to submit froms i brought in from ajax but im not sure why its not working im missing something.

i hope i was able to explain myself im horrible at explaining myself.
@rudydjmedina, yet nobody can recreate the issue using the posted code. To make it right, attach full template that once registered on @kk's side is fully functional i.e. has JS, editable fields etc. If necessary make a few templates, which demonstrate the problem without extra furnish. Sometimes reading twice helps ;)
details sent over PM
5 posts Page 1 of 1