Jump to content
Larry Ullman's Book Forums

How To Handle 2 Forms For One Action?


Recommended Posts

Hello,

 

I have a page with 2 forms in separate div tags.

the first form is for inserting the subject with the body to the database and the second form is for the list of categories with checkboxes.

What I want is to be able to insert the subject and check the category.

Any idea how to handle 2 forms for the same action?

 

Your help is appreciated.

Link to comment
Share on other sites

To be honest, I think you need to take a step back and rethink your form to begin with. I don't see any reason why you'd want to separate one form into two distinct-looking divs. I think it would only serve to confuse the user.

 

With that said, if you really wanted to do want you want to do, you'd create one form, and then put separate divs within that form. For example:

 

<form>

 <div>

   // Input items here.

 </div>

 <div>

   // Check boxes here.

 </div>

</form>

 

That is syntactically correct and would work in HTML, but semantically speaking, it's a mess, and I would not encourage it.

 

Anyway, that's hopefully the answer you're looking for, but again, if you feel the need to do this, I'd rethink your design first and foremost.

Link to comment
Share on other sites

To be honest, I think you need to take a step back and rethink your form to begin with. I don't see any reason why you'd want to separate one form into two distinct-looking divs. I think it would only serve to confuse the user.

 

With that said, if you really wanted to do want you want to do, you'd create one form, and then put separate divs within that form. For example:

 

<form>

 <div>

   // Input items here.

 </div>

 <div>

   // Check boxes here.

 </div>

</form>

 

That is syntactically correct and would work in HTML, but semantically speaking, it's a mess, and I would not encourage it.

 

Anyway, that's hopefully the answer you're looking for, but again, if you feel the need to do this, I'd rethink your design first and foremost.

Thank you.

I will try it.

I am just trying to make a CMS that look and work exactly as the word press CMS.

if you have an account with them, check the admin area and see what I am trying to achive.

Link to comment
Share on other sites

Semantically I suppose it really should use <fieldset> rather than <div> tags as (depending on your HTML declaration) won't validate. A fieldset works the same as a div except it's designed to group elements within a form.

 

Also if I were you I'd just customise the Wordpress admin pages rather than trying to re-create them.

Link to comment
Share on other sites

Semantically I suppose it really should use <fieldset> rather than <div> tags as (depending on your HTML declaration) won't validate. A fieldset works the same as a div except it's designed to group elements within a form.

 

Also if I were you I'd just customise the Wordpress admin pages rather than trying to re-create them.

Thanks for the advice.

 

I did not customize the admin pages because I am doing this for learning purposes. I like to create things from scratch so I know how things work.

I am going to school in next Sep majoring in Computer programming analyst, so learning such things would make it easier for me in my study.

Link to comment
Share on other sites

 Share

×
×
  • Create New...