Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Where is the formatting for form buttons? (http://www.mysidiaadoptables.com/forum/showthread.php?t=4855)

Infernette 06-17-2015 08:04 PM

Where is the formatting for form buttons?
 
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...

Kyttias 06-17-2015 09:13 PM

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 Code:

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

Which is rendering something like this:

HTML Code:

<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 Code:

$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

Infernette 06-17-2015 09:53 PM

Yep! Thank you. I'll still keep searching for all of the locations since I want to know where its rendering for later purposes. :)

Hall of Famer 06-17-2015 09:57 PM

The better way to do this is as follows:

PHP Code:

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

But of course, Kyttias' approach will work too.

Infernette 06-18-2015 06:47 PM

That could be useful; thanks!


All times are GMT -5. The time now is 05:03 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.