Nested forms

Author Message

Alejandro Serrano

Friday 26 January 2007 3:10:20 pm

Hi,
In our web site we have a feature for weblogs. In a weblog entry, we include any comments made to them. Each comment includes an "Edit" button, and the entire entry contains another "Edit" button.
The problem is that when I click "Edit" on a comment, I'm redirected to edit the entry instead of the comment. I think that the problem is that there are two nested forms, and the browser gets the information from the outer, that is the entry, instead of the inner.
Is there any way to achieve this functionality? I need to have a main form surrounding the entire entry+comments so I can remove comments.

Thanks in advance,
Alejandro Serrano

Ville Mattila

Sunday 28 January 2007 9:33:49 am

HTML does not allow nested forms, so you have to close another form before defining a new one. You said that you must have nested forms to be able to remove comments. It's impossible, so you should move the comment removal functionality in the same script as editing comments. I do not see any reason why it wouldn't be possible.

Ville

---

<form action="blog/edit">
<!-- Blog Message -->
</form>

<form action="comment/edit">
<input type="hidden" value="commentid" value="1">
<!-- Comment 1 -->
</form>

<form action="comment/edit">
<input type="hidden" value="commentid" value="2">
<!-- Comment 2 -->
</form>

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 18:40:59
Script start
Timing: Jan 18 2025 18:40:59
Module start 'layout'
Timing: Jan 18 2025 18:40:59
Module start 'content'
Timing: Jan 18 2025 18:40:59
Module end 'content'
Timing: Jan 18 2025 18:40:59
Script end

Main resources:

Total runtime0.0190 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 587.7891152.6094
Module start 'layout' 0.00680.0026 740.398439.4141
Module start 'content' 0.00940.0071 779.812589.1797
Module end 'content' 0.01660.0024 868.992230.3047
Script end 0.0189  899.2969 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003618.9745140.0003
Check MTime0.00115.7024140.0001
Mysql Total
Database connection0.00084.145310.0008
Mysqli_queries0.00189.321530.0006
Looping result0.00000.069110.0000
Template Total0.002010.510.0020
Template load0.00083.998310.0008
Template processing0.00126.473410.0012
Override
Cache load0.00052.733810.0005
General
dbfile0.00031.362580.0000
String conversion0.00000.035240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs