DWZ
11-27-2002, 07:28 AM
I want the "Submit new thread" and "Preview Post" button to lock whenever someone clicks it. I found some JavaScript for a generic form on the internet and tried to get it to work with vBulletin.
The original code was:<script language="JavaScript">
function dis(obj)
{
for(i=0;i<obj.length;i++)
if(obj.elements[i].type == "submit" || obj.elements[i].type == "reset")
obj.elements[i].disabled = true;
}
</script>[/code]I changed that too:<script language="JavaScript">
function dis(obj)
{
for(i=0;i<obj.length;i++)
if(obj.elements[i].type == "submit" || obj.elements[i].type == "preview")
obj.elements[i].disabled = true;
}
</script>
I then added the following just after my body tag:[code]<form onsubmit="return dis(this)">Now, the button locks when you click it, but it wont post the thread or reply, it takes you to some strange URL, for example:
http://localhost/forums/newreply.php?action=postreply&threadid=78&title=&iconid=0&mode=0&status=Use+these+controls+to+insert+vBcode&message=no+%2C+i+eat+ham+and+stuff&parseurl=yes&signature=yes&MAX_FILE_SIZE=2097152&attachment=
and the post is never submitted.
Any ideas?
The original code was:<script language="JavaScript">
function dis(obj)
{
for(i=0;i<obj.length;i++)
if(obj.elements[i].type == "submit" || obj.elements[i].type == "reset")
obj.elements[i].disabled = true;
}
</script>[/code]I changed that too:<script language="JavaScript">
function dis(obj)
{
for(i=0;i<obj.length;i++)
if(obj.elements[i].type == "submit" || obj.elements[i].type == "preview")
obj.elements[i].disabled = true;
}
</script>
I then added the following just after my body tag:[code]<form onsubmit="return dis(this)">Now, the button locks when you click it, but it wont post the thread or reply, it takes you to some strange URL, for example:
http://localhost/forums/newreply.php?action=postreply&threadid=78&title=&iconid=0&mode=0&status=Use+these+controls+to+insert+vBcode&message=no+%2C+i+eat+ham+and+stuff&parseurl=yes&signature=yes&MAX_FILE_SIZE=2097152&attachment=
and the post is never submitted.
Any ideas?