Jump to content

Ignoring Form Break


23.12.2012

Recommended Posts

Hi! Long time no see! I've been spending less time on web things lately, so I've kind of forgot what I knew last year. I've finally decided to start learning PHP, and I'll be doing it by implementing a user-management system while reading through a book (Head First PHP with MySQL from O'Reilly Media, if anyone is curious). I'm still at the index.htm creation, but I've got a little bit of problem: I want the following form to be displayed this way: three forms on row one, three forms on row two. I know it's a CSS thing, so please, enlighten me :)

<p class="data_retrival_info">Nume:</p><input type="text" name="firstname" class="form_customization" /><p class="data_retrival_info">Preume:</p><input type="text" name="firstname" class="form_customization" /><p class="data_retrival_info">Telefon:</p><input type="text" name="firstname" class="form_customization" /><p class="data_retrival_info">Adresă:</p><input type="text" name="firstname" class="form_customization" /><p class="data_retrival_info">CNP:</p><input type="text" name="firstname" class="form_customization" /><p class="data_retrival_info">Nr. Înregistrare:</p><input type="text" name="firstname" class="form_customization" />

The hard way would be to create IDs for each input, using position: absolute. Is there a better way than this? I bet yes...Later EDIT I've managed to do this using a fieldset in HTML. Apparently, the problem was, actually, HTML-related, the <p> creating a break automatically.

Link to comment
Share on other sites

Hi! Long time no see! I've been spending less time on web things lately, so I've kind of forgot what I knew last year. I've finally decided to start learning PHP, and I'll be doing it by implementing a user-management system while reading through a book (Head First PHP with MySQL from O'Reilly Media, if anyone is curious). I'm still at the index.htm creation, but I've got a little bit of problem: I want the following form to be displayed this way: three forms on row one, three forms on row two. I know it's a CSS thing, so please, enlighten me :)
<p class="data_retrival_info">Nume:</p><input type="text" name="firstname" class="form_customization" /><p class="data_retrival_info">Preume:</p><input type="text" name="firstname" class="form_customization" /><p class="data_retrival_info">Telefon:</p><input type="text" name="firstname" class="form_customization" /><p class="data_retrival_info">Adresă:</p><input type="text" name="firstname" class="form_customization" /><p class="data_retrival_info">CNP:</p><input type="text" name="firstname" class="form_customization" /><p class="data_retrival_info">Nr. Înregistrare:</p><input type="text" name="firstname" class="form_customization" />

The hard way would be to create IDs for each input, using position: absolute. Is there a better way than this? I bet yes...Later EDIT I've managed to do this using a fieldset in HTML. Apparently, the problem was, actually, HTML-related, the <p> creating a break automatically.

Rather than <p> (which stands for paragraph, and you're not representing a paragraph there), use the <label> element. That's specifically what it's for. Additionally, when clicking on a <label> element, you give focus to the form field it is assigned to.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...