How to use <button> tags within MyBB forms?
Destro Offline
Junior Member
**
Posts: 39
Joined: Nov 2012
Post: #1
How to use <button> tags within MyBB forms?
Hello.

I've some trouble in using <button> tags within MyBB forms.

For example :

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
<form action="newthread.phpXXXX">
...
<button name="submit" type="submit">
<span>Post Thread</span>
</button>

<button name="previewpost" type="submit">
<span>Preview Post</span>
</button>
...
</form>



And you will know what happen Frown When click  to the Preview button, it will do post thread process Smile

I don't know which file where I can handle the preview process in MyBB. I found in the "newthread.php"

Code:
$mybb->input['action'] == "previewpost"


But I don't know what it do exactly...


Thanks for your reading.

04-27-2013 03:21 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #2
RE: How to use <button> tags within MyBB forms?
Specify a value for your buttons.

04-27-2013 03:39 AM
Find all posts by this user Quote this message in a reply
Destro Offline
Junior Member
**
Posts: 39
Joined: Nov 2012
Post: #3
RE: How to use <button> tags within MyBB forms?
(04-27-2013 03:39 AM)RateU Wrote:  Specify a value for your buttons.

Please explain it more detail. I'm quite new to MyBB.

Do you mean

PHP Code:
<button type="button" value="previewpost">Preview Post</button>

(This post was last modified: 04-27-2013 09:38 AM by Destro.)
04-27-2013 09:37 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #4
RE: How to use <button> tags within MyBB forms?
Something like this:

HTML Code
<button type="submit" name="previewpost" value="previewpost">Preview Post</button>


(This post was last modified: 04-28-2013 07:28 AM by RateU.)
04-28-2013 07:28 AM
Find all posts by this user Quote this message in a reply
Destro Offline
Junior Member
**
Posts: 39
Joined: Nov 2012
Post: #5
RE: How to use <button> tags within MyBB forms?
(04-28-2013 07:28 AM)RateU Wrote:  Something like this:

HTML Code
<button type="submit" name="previewpost" value="previewpost">Preview Post</button>


Thanks you. I solved it few days ago. But really thanks you so much!

But I've new small issue.

In the forumdisplay_inlinemoderation template, I'm using this instead of MyBB <input> tags.

PHP Code:
<button class="ui-button button2" id="inline_go" name="go" type="submit"><span><span>{$lang->inline_go}({$inlinecount})</span></span></button>
&nbsp;
<button class="ui-button button2" onclick="javascript:inlineModeration.clearChecked();" type="button"><span><span>{$lang->clear}</span></span></button>


The clear button is working and also the go button is working too. But the {$inlinecount} not display correct.

When I check to the checkbox, it will change the value attribute of <button> tags


What should I do?

(This post was last modified: 04-29-2013 11:26 PM by Destro.)
04-29-2013 11:25 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #6
RE: How to use <button> tags within MyBB forms?
The inlinecount "auto update" is related to the inline_moderation.js file. So maybe you need to look at (maybe you need to modify) the file.

04-30-2013 02:42 AM
Find all posts by this user Quote this message in a reply
Destro Offline
Junior Member
**
Posts: 39
Joined: Nov 2012
Post: #7
RE: How to use <button> tags within MyBB forms?
(04-30-2013 02:42 AM)RateU Wrote:  The inlinecount "auto update" is related to the inline_moderation.js file. So maybe you need to look at (maybe you need to modify) the file.

Yes, I know and I checked it before I posted the previous post. The inlinecount will be set for the value attribute. But the button element don't need value attribute.

For example,

Old inlinecount will change the value attribute like this :

PHP Code:
<input value="Go (0)" />
When we tick to some threads
==> <input value="Go (1)" />


And now with the button it will look like this :

PHP Code:
<button>Go (0)</button>
When we tick to some threads
==> <button value="Go (1)">Go (0)</button>
instead of
==> <button>Go (1)</button>


How to do that? I have no idea with javascript Frown

05-04-2013 04:33 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #8
RE: How to use <button> tags within MyBB forms?
Set the inline_go id to your span (not to your buttons), then edit the file, maybe use innerHTML for the elements that use the id (goButton). You can find more than one in that file.

05-04-2013 04:42 AM
Find all posts by this user Quote this message in a reply
Destro Offline
Junior Member
**
Posts: 39
Joined: Nov 2012
Post: #9
RE: How to use <button> tags within MyBB forms?
Works like a charm Smile Thanks a lot, RateU !

Have a Good day!
05-05-2013 09:59 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: