You can't just "kill" the input. If you do, then the necessary data might not get sent to the server when you submit the form.
So, hide the input and show its value. Here's a complete script that uses the awesome power of jQuery to do that:
// ==UserScript==
// @name Make Priority more user friendly
// @include http://YOUR_SERVER.COM/YOUR_PATH/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @grant GM_getValue
// ==/UserScript==
//--- The @grant is to subvert a huge design flaw, introduced with GM version 1.
var oldInput = $("input[name=prio]");
var priorityVal = oldInput.val ();
oldInput.after ('<b id="gmPriorityValue">' + priorityVal + '</b>');
oldInput.remove ();
$("#gmPriorityValue").before ('<input type="hidden" name="prio">');
$("input[name=prio]").val (priorityVal);
Change the @include
value to match your site(s).
Note that you can't change an <input>
s type, so we delete the old input and create a new one with the same value, but hidden.
Re: do that without jquery? the pc has no internet connection
:
You're going to sneak the script file onto the PC, right? :)
Download and sneak jQuery onto it too. With the jQuery file and the userscript file in the same folder, change the @require
line to:
// @require jquery.min.js
Then the script will install just fine, no internet connection required.
Re: maybe the easiest way is to disable the input field
:
Okay, the script to do that is:
// ==UserScript==
// @name Make Priority more user friendly
// @include http://YOUR_SERVER.COM/YOUR_PATH/*
// @grant GM_getValue
// ==/UserScript==
var oldInput = document.querySelector ("input[name=prio]");
oldInput.setAttribute ("disabled", "disabled");
Update:
Extremely crucial information was omitted from the question -- mainly that this is meant for Firefox 2.0(!!!) and Greasemonkey 0.8. Given that, change the code for the last script to:
var oldInput = document.getElementsByName ("prio");
oldInput[0].setAttribute ("disabled", "disabled");
It should work, but it's impossible to test, and compatibility tables don't even cover such an obsolete browser.