Click to See Complete Forum and Search --> : Remove submit button black border
floodboy
03-09-2003, 09:56 PM
When I have a form, let's say a text field and a submit button and a reset button, when I'm writing something in the textfield appear a black border around the submit button so how can I avoid this border to appear ? :confused:
jjohnstn
03-09-2003, 10:35 PM
Originally posted by floodboy
When I have a form, let's say a text field and a submit button and a reset button, when I'm writing something in the textfield appear a black border around the submit button so how can I avoid this border to appear ? :confused:
Is it an actual form button or a graphic being used as a button? If the latter, use border=0
floodboy
03-09-2003, 10:56 PM
It s single button you can even see it here when you post a reply the "Submit reply" button looks darker than the "preview reply button" this is because the border that I'm telling you :)
I really hate that border I want to know how to remove it, some guy told that doing this:
INPUT TYPE=\"button\" value=\"submit\" onClick=\"this.form.submit()\"
Will remove the border and actully it does, plus works just like the submit button so you will wonder, if this works what's the problem ? well the problem is that I have a "click once" script and if I have a type=submit this script will lock the button, but if I use the type=button the "click once" script don't work :(
And I really don't want to exchange one for another I want both to work in harmony :D
thi is my click once script
function submitonce(theform){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
//screen thru every element in the form, and hunt down "submit" and "reset"
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
//disable em
tempobj.disabled=true
}
}
}
this script work only if I have a type=submit so I changed this line tempobj.type.toLowerCase()=="submit" to tempobj.type.toLowerCase()=="button"
To see I like this could work with the type=button but didn't work :p
Any idea ?
Nicodemas
03-10-2003, 06:40 AM
Instead of using that tempobj.type junk, use names.
<HTML>
<HEAD>
<SCRIPT LANGUAGE="Javascript">
function submitonce(theform){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
//screen thru every element in the form, and hunt down "submit" and "reset"
for (i=0;i<myForm.length;i++){
var tempobj=myForm.elements[i]
if(tempobj.name=="myButton1"||tempobj.name=="myButton2")
//disable em
tempobj.disabled=true
}
}
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#0000ff" TEXT="#FFFFFF">
<FORM NAME="myForm" STYLE="margin-left:25px">
myText 1: <INPUT TYPE="text" NAME="myText0" value="Some stuff"><P>
myText 2: <INPUT TYPE="text" NAME="myText1" value="More stuff"><P>
<INPUT TYPE="button" VALUE="Start" NAME="myButton1" onClick="submitonce()"> <INPUT TYPE="Reset"
VALUE="Reset" NAME="myButton2">
</FORM>
</BODY>
</HTML>
Now all you gotta do is add the names myButton1 and myButton2 to the buttons that you want to disable. Like so...
<INPUT TYPE="button" VALUE="Start" NAME="myButton1" onClick="submitonce()"> <INPUT TYPE="Reset"
VALUE="Reset" NAME="myButton2">