is there a way to tell the web browser what form button is selected on a page by default when the page loads? Now when the page loads the first button is slected by default.
Use Javascript. Just use "document.FormName.ButtonName.focus()" whenever you want to change which form element is selected:
<html> <body onLoad="document.Form1.Button1.focus();"> <form name="Form1"> <input type="text" value="Text field"> <input type="button" value="Button #1" name="Button1"> <input type="button" value="Button #2" name="Button2"> </form> </body></html>
thanks man
hmmm....
I'm using the button as a link so it's not in a for just
<input type="submit" name="Submit27" value="PREVENTION" class="prevB" onClick="document.location = 'prevention.php'">
I couldn't get onload code to work for this.
You need it to be in a form for it to work. Just put it in a form, otherwise, I don't think it will work.
is there another way? cause when I put it in a form it doesn't work the same way for linking to another page
Well, also, since you're just using the button as a link, don't make it submit. Just use type="button" and then it'll work.
thanks!
I guess I should have knowen that but... well I didn't:rolleyes: