Topic on Project:Support desk

hiding "Save page" button after click

7
185.31.48.30 (talkcontribs)

Hello All,

I am using semantic media wiki forms to gather information from users. When they accidentally click on "Save page" button twice, two seperate articles are created. Any idea how to make the button disappear immediately after clicking on it?

Florianschmidtwelzow (talkcontribs)

Hello, maybe with a little JavaScript? Write an extension, which loads your own little module and bind the click event of "#wpSave" (please make sure, if this is the right id for the save button :)). to it. After clicked, add "disabled" or use remove() from jQuery :)

More information for that you can find here:

Load your module with ResourceLoader: https://www.mediawiki.org/wiki/ResourceLoader/Developing_with_ResourceLoader

How to develope an extension: https://www.mediawiki.org/wiki/Manual:Developing_extensions

jQuery is shipped with MediaWiki (i think with SMW, too, but i'm not sure), so you can use jQuery to bind the click event and remove the element.

Ciencia Al Poder (talkcontribs)

This looks to me as a good feature request to add to bugzilla for that extension.

Florianschmidtwelzow (talkcontribs)
Florianschmidtwelzow (talkcontribs)

@185.31.48.30: Can you reply to the question:

> I assume this is only an issue when using the "one-step process", with an automatically-generated page name?

Thanks! :)

185.31.48.30 (talkcontribs)

Yes this is true, page names are automatically created (reference numbers).

185.31.48.30 (talkcontribs)

using this:

{{{info|page name=REF<unique number;start=000001>}}}

Reply to "hiding "Save page" button after click"