This may be an easy one and I used to be able to do this in old versions of DW, but how to make a field open (i.e. you can type in it straight away) without clicking on it first. Examples - the search boxes in Yahoo/Google...you don't need to click on them before you type your search. Thanks
It's javascript, did you looked at google code? you can do that: <body onload="myfunction()"> Code (markup): now, betweeen the <head> and the </head> you have to add: <script type="text/javascript"> <!-- function myfunction() { this.focus() }; // --> </script> Code (markup): This should work, but if not you reply here or do some test. I am not a javascript guru (I'm reallyyyyy far waya from) but this is basically the idea.
Heres what i use: add this onload statement to your <body> tag. <body OnLoad="document.requestform.aname.focus();"> PHP: syntax is document.[formname].[fieldname that needs the focus].focus() below is the input field that will be recieving the focus... see how the name of it is "aname" - same as in the onload statement? <input type="text" name="aname" value=""> PHP: hope this helps
Well Mishoni, I thought you had already solved this problem. But look like not. I think it didn't work cause you haven't read carefully what he said. Please note this And note now the [formname]. Give your form a name and it will work. But if you do not want to think, find te code below <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title> </title> </head> <body onload="document.myform.myinput.focus()"> <form name="myform"> <input name="myinput" type="text" /> <input type="button" value="GO!" /> </form> </body> </html> Code (markup): Is that easy. Look at "myfrom" and look at "myinput". Look too at the onload statement. It's that easy man. cagintranet in fact solved your problem already.
Err thanks for the beginneers run thru, your rcode didn't work for me though - I've got multi-layered dynamic tabs on my site same as Google/Yahoo and it doesn't pick it up. Here's the code I've been messing with but I don't think there's a solution. No Cagintranet's code gives JS errors... <script> <!-- function selector(){document.schina.q.focus();} d=document; // --> </script> </head> <body onLoad=selector()>
Thanks for the offer, I've spent a couple of hours on it and realised it's not worth it at this moment...is ok thanks for the help though.
document.form.fieldname.focus() does not seem to work on Safari when i test it. Is anyone else having this trouble? Anyone can provide a solution please?
Try this: <body onload="document.forms.n1.n3.focus()"> <form name="n1"> <input name="n2"><input name="n3"> </form> </body> or this: <body onload="document.getElemenetById("id3").focus()"> <form> <input name="n2"><input name="n3" id="id3"> </form> </body> J.D.