Forms Customization

(This document pertains to Enthusiast 3.x and above only.)

The look of the different forms may be customized using CSS (please see Classes and styles). However, the additional fields for Enthusiast 3.x automatically transform underscores (_) to spaces, so if you have set up your fields to contain underscores, by default it will show up like below:

Additional field names:

  • favorite_character
  • favorite_scene
  • is_mr_darcy_hot
  • link_to_where_the_code_is

Display:

Favorite Character:

Favorite Scene:

Is Mr Darcy Hot:

Link To Where The Code Is:

However, you might like to use dropdown fields, or radio buttons, or even a textarea instead of the default text field. To do this, you can create a file named addform.inc.php, placed in your fanlisting root, with the contents of the file like so:

<p>Favorite character from the movie:<br />
<select name="favorite_character">
<option>Character 1</option>
<option>Character 2</option>
</select>
</p>

<p>Favorite scene from the movie (255 characters max):<br />
<textarea name="favorite_scene" rows="3" cols="50"></textarea></p>

<p>Is Mr. Darcy hot?<br />
<input type="radio" name="is_mr_darcy_hot" value="Hell yes!" checked="checked" /> Hell yes!<br />
<input type="radio" name="is_mr_darcy_hot" value="Uhm, he's okay, I guess." /> Uhm, he's okay, I guess.</p>

<p>Link to where your fanlisting code is:<br />
<input type="text" name="link_to_where_the_code_is" size="20" value="http://" /></p>

And the above will then show (in the join form):

 

Favorite character from the movie:

Favorite scene from the movie (255 characters max):

Is Mr. Darcy hot?
Hell yes!
Uhm, he’s okay, I guess.

Link to where your fanlisting code is:

Important Notes

  • Make sure your input tag names (the name attribute of input/textarea/select tags) are named as your database column is named, which is the name you supplied it upon creation (see the database section of the listing’s edit page to see the name of the column).
  • If you want to customize one field, you have to customize all of them. For example, you want to make only one of the additional fields into a select tag (a drop-down field); you not only have to include that in your form, but you will have to create input tags for everything else (like in the above example, we still needed to create an input tag for the fanlisting code link, even though it was only a text field).
  • Especially if your web server does not hide PHP errors when parsing PHP, or if you’re just as nitpicky as I am, when using radio fields (i.e., <input type="radio"...), you have to automatically select at least one (i.e., <input type="radio" checked="checked"...).
  • These additional forms only allow up to 255 characters, spaces included. So be sure to limit characters if you’re using a textarea.