user1443519 user1443519 - 2 years ago 96
PHP Question

Select list and submit button on same line with CakePHP

I'm using a select list and submit button with CakePHP but I'm trying to get it on the same line and I can't figure it out. I've tried putting them in a table as well but that didn't work either.

Here is the form

<div class="visits options">
echo $this->Form->create('Sort_Visits');
echo $this->Form->input('Sort', array('options' => $options));
echo $this->Form->end(__('Submit'));

Here's the CSS

div.options {
float: left;
vertical-align: top;

Here's the output

<div class="visits options">
<form action="/visits/index" id="Sort_VisitsIndexForm" method="post" accept-charset="utf-8"><div style="display:none;"><input type="hidden" name="_method" value="POST"/><input type="hidden" name="data[_Token][key]" value="233e6286a426dc782186142dde352208eddc8349" id="Token1459082309"/></div><div class="input select"><label for="Sort_VisitsSort">Sort</label><select name="data[Sort_Visits][Sort]" id="Sort_VisitsSort">
<option value="today">Today</option>
<option value="this_week">This Week</option>
<option value="filled">This Month</option>
<option value="not_filled">Previous Visits</option>
</select></div><div class="submit"><input type="submit" value="Submit"/></div><div style="display:none;"><input type="hidden" name="data[_Token][fields]" value="a17c91b362e9e635b23dfd139c314f081f977590%3A" id="TokenFields1535487420"/><input type="hidden" name="data[_Token][unlocked]" value="" id="TokenUnlocked1391584397"/></div></form>

Answer Source

This ended up working for me in my browser using float.

.input {

.submit {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download