Yeah, it seems to work better.
Since I coded it up to test it, might as well post the code. I guess Joe will see it sometime.
Top to bottom on the template:
// Replaces VSver()
Code:
var vs_ver = null;
function setVSver(ver)
{
vs_ver = ver;
}
function addVSver()
{
if (vs_ver == null) {
alert('Please select your version of Visual Studio using the radio buttons.');
return false; // Cancel the submit
}
var titleElement = document.getElementById('title');
if (titleElement.value.match(/\[[0-9\/]{4,5}\]/))
titleElement.value = titleElement.value.replace(/\[[0-9\/]{4,5}\]/, ver);
else
titleElement.value = vs_ver + ' ' + titleElement.value;
}
// Replaces opening <form action="newthread.php"> line
HTML Code:
<!-- P: Validate title/post BEFORE VS version -->
<form
action="newthread.php"
method="post"
name="vbform"
onsubmit="return validatePost(this, this.subject.value, 4, 10000) && addVSver();"
onreset="vB_RESET(this);"
>
// Also added <label> tags for the radio buttons. Makes the UI work a bit better.
HTML Code:
Please select your version of Visual Studio:
<input type="radio" id="vs03" name="vs" onclick="setVSver('[02/03]')" /><label for="vs03">VS 02/03</label>
<input type="radio" id="vs05" name="vs" onclick="setVSver('[2005]')" /><label for="vs05">VS 2005</label>
I do realise that makes the VS version mandatory. If that's not a desirable effect then just take out the if (vs_ver == null) section and add a return true at the end of that function.