/    Sign up×
Community /Pin to ProfileBookmark

Hi,

Has anyone managed to come up with a good solution to creating forms within forms in HTML? Similar to the way Access does, when you can create a form to control say “customers” and then that form has a subform within it which lists “orders” (only those relative to the current customer) and you can manage those orders via that subform.

The trouble I’m having is that in html you can’t nest form tags, so I’m not sure how to do it. I’m using XMLHttpRequest to submit the form, and that has its own custom script that gets the form data and puts it into a URL encoded string. I guess I could mark each form field with the form it applies to, and then get that script to only get the data from those fields?

The easiest way I can think of is to have completely separate forms, and then use absolute positioning to position the second within the first, but that isn’t going to work because the forms scroll down the page and stuff, they also get longer when validation error messages come back from the server. I really want to keep the second form inline with the first.

What do you think? Is there a good way to do this?

Thanks,
Jack

P.S. I dont want to use iframes.

to post a comment
HTML

1 Comments(s)

Copy linkTweet thisAlerts:
@ray326Mar 01.2006 — Just use a second form for the orders. Put a hidden field in it that relates the orders to the customer if the app needs it. The bottom line is that the forms are just part of the view. The state of the customer and orders should be maintained as objects on the server.
×

Success!

Help @Jak-S spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...