• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

AAC Button Search.

Pedrook

Advanced OT User
Joined
May 24, 2009
Messages
442
Solutions
3
Reaction score
183
Location
Brazil
I'm using gesior, and editing a new layout, but I'm not able to implement the "seach character" system on this button, could anyone help me?


ri7yeyk.png



PHP:
<!-- Header Navigation Left -->
                <ul class="nav-header pull-left">
                    <li class="visible-xs">
                        <!-- Toggle class helper (for .js-header-search below), functionality initialized in App() -> uiToggleClass() -->
                        <button class="btn btn-default" data-toggle="class-toggle" data-target=".js-header-search" data-class="header-search-xs-visible" type="button">
                            <i class="fa fa-search"></i>
                        </button>
                    </li>
                    <li class="js-header-search header-search">
                        <form class="form-horizontal" action="base_pages_search.html" method="post">
                            <div class="form-material form-material-primary input-group remove-margin-t remove-margin-b">
                                <input class="form-control" type="text" id="base-material-text" name="base-material-text" placeholder="Search.." style="left: 70px;">
                                <span class="input-group-addon"><i class="si si-magnifier"></i></span>
                            </div>
                        </form>
                    </li>
                </ul>
                <!-- END Header Navigation Left -->
 
Solution
If you want the form to be send through URL and not hidden, then you need to change the method of the form, from "post" to "get".

Like this: method="get". Also, change action just to action="?view=characters".

Also, I'm not sure - what is "_token" field? Is it csrf protection?
I have managed to do it this way so far, but when I put it to search the bar, it only
Characters - Alvoria-ATS
and should stay
Characters - Alvoria-ATS

PHP:
<!-- Header Navigation Left -->
                <ul class="nav-header pull-left">
                    <li class="visible-xs">
                        <!-- Toggle class helper (for .js-header-search below), functionality initialized in App() -> uiToggleClass() -->
                        <button class="btn btn-default" data-toggle="class-toggle" data-target=".js-header-search" data-class="header-search-xs-visible" type="button">
                            <i class="fa fa-search"></i>
                        </button>
                    </li>
                    <li class="js-header-search header-search">
                        <form method="post" class="navbar-form navbar-right" style="margin-right:0;" action="?view=characters&name=">
                <input type="hidden" name="_token" value="4t0VL0Zh7MkvcOHZQ9gaXXma40r7FchIV9fhbjWP">
                <div class="form-group">
                    <input type="text" name="name" placeholder="Search Character" class="form-control" onfocus="this.value=''" onblur="if(this.value=='') { this.value='Find player...'};">
                </div>
                <input type="submit" name="Submit" class="btn btn-primary btn-sm" value="Search">
            </form>
                    </li>
                </ul>
                <!-- END Header Navigation Left -->
 
If you want the form to be send through URL and not hidden, then you need to change the method of the form, from "post" to "get".

Like this: method="get". Also, change action just to action="?view=characters".

Also, I'm not sure - what is "_token" field? Is it csrf protection?
 
Last edited:
Solution
If you want the form to be send through URL and not hidden, then you need to change the method of the form, from "post" to "get".

Like this: method="get". Also, change action just to action="?view=characters".

Also, I'm not sure - what is "_token" field? Is it csrf protection?
I do not know, I copied from another place, as you were told. Thank you again.
 
Back
Top