bahaa Posted June 15, 2011 Share Posted June 15, 2011 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 More sharing options...
HartleySan Posted June 15, 2011 Share Posted June 15, 2011 Put it all together into one form? Link to comment Share on other sites More sharing options...
bahaa Posted June 15, 2011 Author Share Posted June 15, 2011 Put it all together into one form? I can't because I used them with 2 diff dives one of the div on the left that display the categories Link to comment Share on other sites More sharing options...
HartleySan Posted June 15, 2011 Share Posted June 15, 2011 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 More sharing options...
bahaa Posted June 15, 2011 Author Share Posted June 15, 2011 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 More sharing options...
bahaa Posted June 15, 2011 Author Share Posted June 15, 2011 everything is working fine now. Thanks a lot for your help. Link to comment Share on other sites More sharing options...
HartleySan Posted June 15, 2011 Share Posted June 15, 2011 Cool. Glad that worked. Also, I'll check out the admin area of WordPress sometime soon. I'm curious now. Link to comment Share on other sites More sharing options...
Stuart Posted June 15, 2011 Share Posted June 15, 2011 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 More sharing options...
HartleySan Posted June 15, 2011 Share Posted June 15, 2011 Agreed. With the HTML5 doctype though, it should be okay. Link to comment Share on other sites More sharing options...
bahaa Posted June 15, 2011 Author Share Posted June 15, 2011 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 More sharing options...
HartleySan Posted June 15, 2011 Share Posted June 15, 2011 Sounds good. Good luck with that. Link to comment Share on other sites More sharing options...
bahaa Posted June 15, 2011 Author Share Posted June 15, 2011 Sounds good. Good luck with that. Thank you Link to comment Share on other sites More sharing options...
Recommended Posts