MyBB Community Forums

Full Version: Use jQuery to submit form with Inline-moderation ???
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi.

This is my another question again Wink

As the title :

- How could I use jQuery submit instead of using <input> in MyBB ?

$("form").submit();

For example, with the Inline moderation (my code)

<form method="post" action="moderation.php">

....

<a class="ui-button button2" id="inline_go" onclick="$("form").submit();"><span><span>Go</span></span></a>
&nbsp;
<a class="ui-button button2" onclick="javascript:inlineModeration.clearChecked();"><span><span>Clear</span></span></a>

....

</form>


When I click to "Go" button, it show up me an error message : "Sorry, but you did not select any threads to perform inline moderation on, or your previous moderation session has expired (Automatically after 1 hour of inactivity). Please select some threads and try again."

Althought, I've selected threads/posts already.


Anyone know how to fix ? Which parameters I need to posts on submit (I'm using jQuery to submit form) ?
P/S:

I've solved how to submit the form. Now I'm using the <button> tags for this.

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

But there still have a small issue :
- The {$inlinecount} is not change value when I select a thread/post. The submit using button work fine, but {$inlinecount} does not display (still 0 when you select thread/post)

Do we need the "onchange" ? If yes, what exactly we need to put inside onchange event ?





P/S: I found this in inline_moderation.js

goButton.value = go_text+" ("+inlineModeration.inlineCount+")";

Now instead of changing attribute "value" I want to change the text inside <button> tags.

For example, current when I ticked to the check box, the script will change value attribute in button tag to :

<button class="ui-button button2" id="inline_go" name="go" onclick="submit();" value="{$lang->inline_go}({$inlinecount})"><span><span>{$lang->inline_go}({$inlinecount})</span></span></button>

But I don't want to change the "value" attribute I want to change the text! inside it.

<button class="ui-button button2" id="inline_go" name="go" onclick="submit();"><span><span>{$lang->inline_go}({$inlinecount})</span></span></button>


How ?