Jump to content

"Embedded" Forms Help

Recommended Posts

Currently, the way I have a page set up (there is no other way, unless it's possible to horizontally invert two table cells), a form needs to span across one table and div, and somewhere within, another form starts and ends.This creates no issue with Firefox, but in Internet Explorer 6, the form won't submit. I know it's not a problem with anything else as if I remove the inner form, the page submits fine.Here is a basic layout of what this page looks like HTML wise:

<form (1)><table>   <!-- table stuff -->   <form (2)>   </form (2)>   <!-- table stuff --></table><div>   <!-- form 1 submit button --></div></form (1)>

I'm hoping someone gets what I mean, and that they can give me a solution. Again, this works fine in FF but not IE6.

Link to post
Share on other sites

is this applicable:

<table>   <!-- table stuff -->   <form (2)>   </form (2)>   <!-- table stuff --></table><form (1)><div>   <!-- form 1 submit button --></div></form (1)>

You can have multiple forms, you just can't nest them. If you feel like you have to nest forms, then still only use one form but build your action page (the page the form posts to) to conditionally use the fields being posted.

<form (1)><table>   <!-- table stuff -->   <input type="submit" name="submit2">   <!-- table stuff --></table><div>	  <input type="submit" name="submit1"></div></form (1)>

Then in your action page (using in this example, ColdFusion):

<cfif ISDEFINED("form.submit1")><!-- logic using only the fields you want from form 1 --><cfelseif ISDEFINED("form.submit2")<!-- logic using only the fields you want from form 2 --><cfelse><!-- send error message - invalid page request, please try again --></cfif>

So the action page just uses the pieced of information it needs - even though more is available.

Link to post
Share on other sites

Ahh, as I post you added the DELETE caveat. This is very common. Since a DELETE function rarely needs anything more than the record ID, then you can use a second, separate form for that, just hide the record ID or whatever unique identifier you need.That or the other solution I mention work just as well.

Link to post
Share on other sites

Given the way the page is set up, I can't get around nesting the two forms.I should have mentioned, that the stuff for form 1 is actually in that table, above form 2, it's just that the submit button is in the div.But thats a good idea anyway, I might be able to simply combine the two forms.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...