TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,913
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 588
  • Total: 589
  • @rjen

Generic Application Form

Started by JPDeni, May 23, 2009, 11:04:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ZarPrime

JPDeni,

I have a question.  The "heading" field type appears to be centered as it should be.  However, for the other field types, it looks like there is a TD in the code to align the other fields to the left, but none of them seem to be aligned left except the one with the checkbox.

The code for align left that I'm talking about starts with ...
<TD align="left">';

// Go through each field type


What can I do to make sure that the other fields (not the heading fields) align left in the form?  See Pic below.

ZarPrime

JPDeni

#41
They look like they're aligned to the left to me. The left column (the labels) is aligned to the right and the right column (the fields) is aligned to the left. That way they meet more or less in the middle. Not really the middle because of the varying sizes of the labels and the fields and there's really nothing I can do about that.

But maybe I'm not understanding what you mean.

ETA: Are you talking about the labels lining up to the left? If that's what you want, you'll need to change


// How each field is displayed in the table
echo '
<TR class ="' . $bg . '">
<TD align="right">';
              if ($field['required'] == 1) { echo '* '; }
              echo $field['caption'] . ':
</TD>
<TD align="left">';

// Go through each field type


to


// How each field is displayed in the table
echo '
<TR class ="' . $bg . '">
<TD align="left">';
              if ($field['required'] == 1) { echo '* '; }
              echo $field['caption'] . ':
</TD>
<TD align="left">';

// Go through each field type


The reason that the label connected with the checkbox appears to be aligned to the left is that it's the longest label, so it fills the entire width of the column.

ZarPrime

Ah, OK I see what you mean.  The fields themselves are aligned left in the right TD.  What I was trying to do was align the labels so that that would be aligned left in the left TD like this ...


*Name:
*Age:
*Sex:
Do you like me?:


rather than like this ...

         * Name:
          * Age:
          * Sex:
Do you like me?:


However, that may not look right either if I have a long label because it would probably push the right TD to far to the right.  OK, I'll have to think about that some more.

Thanx,
ZP 

JPDeni

I edited my post to show you how to align them to the left, if you want to give it a try and see how it looks.

ZarPrime

#44
OK, that is definitely what I was looking for, but I'm undecided if that's the look I want when the label is long.  That answers the question though. :up:

TYVM,
ZP

Edit:  Well, it doesn't look so good with the comments field (the longest one) is set for cols="40" but when I changed it to 80 it looks pretty good.  I may do one other thing.  I might change the font for the labels to a fixed width font like courier or something.  That would let me add content to fill in the labels so that they end closer to the fields.  It looks pretty good this way.


ZarPrime

Check my edit above.  I changed the cols on the comments field to 80 and it looks pretty good.

JPDeni

That's great! There's a lot of things that people can do to make it look like they want it to, which is why I kept the formatting at a minimal level in the basic code.

It's gratifying to see someone work with the code and bend it to their will. :D

maviel

#48
Question about the heading

Is it possible to get the heading like this in the code:

Heading < bolded
question 1
question 2
question 3

Heading 2 < bolded
question 1
question 2
question 3

Since my php skills is poor i have no idea how to do this in the code.

JPDeni

Look for


// Headings have their own type of display
if ($field['type'] == 'heading') {
echo '
<TR>
<TD colspan="2" style="text-align: center; text-decoration: underline;">' .
$field['caption'] . '
</TD>
</TR>';
}


In the line


<TD colspan="2" style="text-align: center; text-decoration: underline;">


put whatever you want as inline css. The default has it centered and underlined, but you can put whatever you want in there. No php involved. :-)

This website is proudly hosted on Crocweb Cloud Website Hosting.