hellow every body i have problem to geting focus on radio button i have two radio button with the name tile i have following code but not working please help and how to get focus on chechboxes thanks in advance code: myval=dcument.form1; for (var i=0;i<myval.title.length;i++) { if(myval.title.checked) { mytitle = 1; } } if (mytitle == 0 ) { alert("You must be select title field"); myval.title[0].focus(); return (false); }
How do you know that your radio button does NOT have the focus? Unlike any of the text input field controls in HTML, with the radio button (and the checkbox) you might not necessarily know that you already have the focus on them. The only surefire way to tell is by pressing the spacebar — if the radio button (or checkbox) gets selected or de-selected, then you know you have the focus. Just in case: Setting the focus on a radio button or check box does not automatically "click" (or selecte or check or de-select or un-check) the control. In case I misunderstood, feel free to correct me and/or follow up with some more clarifying explanations.
thanks for reply definately i press space bar but but not checked or uncheked the fucus still remain at submit button