Topic on Extension talk:InputBox

Calebfergie (talkcontribs)

Hi there,


I'm a grad student making a game built on MediaWiki that uses InputBox. Thanks so much for it, I'm new to wiki software and it's exactly what the project needs - especially the 'create' type.

I was wondering if there was a way to make an InputBox that's 'fake'. What I mean is that it automatically navigates to another (existing) page, regardless of what is typed in the box.

I'm having trouble with inputs/forms in MediaWiki and was hoping there was a way to just use InputBox for this purpose.

I'm new to PHP so I'm not confident about modifying the existing extension - so if that's not possible, could you point me to another solution? All the field needs to do is behave like an input (with a button), but route to a page I can specify in the form.


Thanks again for the tool and in advance for any feedback.

Ciencia Al Poder (talkcontribs)

You can use JavaScript for that, which is more flexible.

You can use the type=commenttitle of inputbox to specify a page title, and then with JavaScript, remove the hidden input with name section.

Calebfergie (talkcontribs)

Thanks for getting back to me. This makes sense to me, could you clarify what you mean by "remove the hidden input with name section"?


I see a few hidden inputs within the commentttle form:

  1. <input type="hidden" value="edit" name="action">
  2. <input type="hidden" value="new" name="section">
  3. <input type="hidden" value="Priming Complete" name="title">


Do you mean remove #2?


To clarify, I want the user to go to the view version of the page, not the edit version/action. Is there something else I should change to do this as well?


Calebfergie (talkcontribs)

Update:


I was able to create the intended effect by adding the following JS:

$(function () {$("input[name=action]").remove();}());


Thanks!