Where is the formatting for form buttons?

Forum
Last Post
Threads / Messages

Infernette

CODE CODE CODE CODE CODE
Member
Joined
Jan 29, 2013
Messages
164
Points
0
Location
Where I live? I live home.
Mysidian Dollar
15,625
I need to remove the <br>'s that are automagically placed after buttons in forms; what file handles their formatting? I checked the classes for form and button as well as the css files, and didn't find anything on formatting for the buttons. I haven't actively meddled in forms up until now but my current project requires some mild edits...
 
I'll ask HoF directly about this, but the fastest solution I can think of is to find where the form is being built. You might find something like:

PHP:
$profileForm->add(new Button("Save Changes", "submit", "submit"));

Which is rendering something like this:

HTML:
<button id="submit" value="submit" class="btn" name="submit" type="submit">Save Changes
</button>
<br>

I would take it and change it from adding a new Button to adding a new Comment instead, and instead include the html I want rendered exactly (being sure to use single quotes ' inside of double quotes " otherwise things go haywire):

PHP:
$profileForm->add(new Comment("<button id='submit' value='submit' class='btn' name='submit' type='submit'>Save Changes</button>", FALSE));

Normally, Comments also have linebreaks after them, but setting a final parameter of FALSE negates this. I can't seem to find anything similar to negate the addition of a linebreak after other elements. =T
 
The better way to do this is as follows:

PHP:
$submit = new Button("Save Changes", "submit", "submit");
$submit->setLineBreak(FALSE);
$profileForm->add($submit);

But of course, Kyttias' approach will work too.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,278
Messages
33,127
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top