MyBB Community Forums

Full Version: Center textbox
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
How to do it? What should I should type?
This is html code of that textbox:
<input type="text" class="textbox" name="regsecureans" value="" id="regsecureans" style="width: 100%;"/>
You want to center the whole textbox? Or the text in the textbox?

Whole textbox:

Wrap it in center tags.

<center><input type="text" class="textbox" name="regsecureans" value="" id="regsecureans" style="width: 100%;"/></center>

Center text in textbox:

<input type="text" class="textbox" name="regsecureans" value="" id="regsecureans" style="width: 100%; text-align: center;"/>

Hope this helps!
(2012-08-24, 09:45 PM)NaXuh Wrote: [ -> ]You want to center the whole textbox? Or the text in the textbox?

Whole textbox:

Wrap it in center tags.

<center><input type="text" class="textbox" name="regsecureans" value="" id="regsecureans" style="width: 100%;"/></center>

Center text in textbox:

<input type="text" class="textbox" name="regsecureans" value="" id="regsecureans" style="width: 100%; text-align: center;"/>

Hope this helps!
I need to center textbox. Where I can find that code that I gived to you? That is textbox of security question.
Oh! Sorry, I didn't understand the question fully. My apologies.

You can find it in this teplate.

Admin CP -> Templates & Style -> YourTheme Templates -> Global Templates -> regsecureq

It should be located in that code.
(2012-08-24, 10:06 PM)NaXuh Wrote: [ -> ]Oh! Sorry, I didn't understand the question fully. My apologies.

You can find it in this teplate.

Admin CP -> Templates & Style -> YourTheme Templates -> Global Templates -> regsecureq

It should be located in that code.

It is still same. Can I give you admin info to check it?
Maybe problem is bescause I need to center it inside this "box" that I made. This is where it is located
[Image: untitled.jpg]
I don't need to center it on whole page. I need to center it just inside that box.
You need to look at the registration security question in the global templates. There you can center the box. You need to read up on basic css and html.
(2012-08-24, 10:32 PM)Leefish Wrote: [ -> ]You need to look at the registration security question in the global templates. There you can center the box. You need to read up on basic css and html.

I know that I should look there and I found part of code that I need to edit. Also I know basic of css and html but I learned it long ago and I forgot most of things.
If you found the code, then select it and replace it with this code:

<center><input type="text" class="textbox" name="regsecureans" value="" id="regsecureans" style="width: 100%;"/></center>
(2012-08-25, 12:46 AM)NaXuh Wrote: [ -> ]If you found the code, then select it and replace it with this code:

<center><input type="text" class="textbox" name="regsecureans" value="" id="regsecureans" style="width: 100%;"/></center>

I already did and everything is still same.
Oh, I see. I looked into it more and did it on my test forum now. It already is "centered" in the table because it has 60% of the table, and the "next question (if you had one)" gets the other 40%.

To center, find this:

<td width="60%"><br /><input type="text" class="textbox" name="regsecureans" value="" id="regsecureans" style="width: 100%;" /><input type="hidden" name="regsecureq_id" value="{$regsecureq_id}" id="regsecureq_id" /></td>
<td align="right" valign="bottom">
{$regq_button}
</td>

And replace it all with this:

<td width="100%"><br /><center><input type="text" class="textbox" name="regsecureans" value="" id="regsecureans" style="width: 60%;" /></center><input type="hidden" name="regsecureq_id" value="{$regsecureq_id}" id="regsecureq_id" /></td>

Please note, this removes the "change question" button that only appears if you have more then one question. If you want that still there (for if you ever want another question), replace instead with this code:

<td width="100%"><br /><center><input type="text" class="textbox" name="regsecureans" value="" id="regsecureans" style="width: 60%;" /><input type="hidden" name="regsecureq_id" value="{$regsecureq_id}" id="regsecureq_id" /><br /><br />{$regq_button}</center></td>

Just did this all on my test forum, it should work fine for you. Hope this helps! Smile.
Pages: 1 2