Problem with radio buttons

Discussion in 'JavaScript' started by nabi bux, Jul 14, 2007.

  1. #1
    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);
    }
     
    nabi bux, Jul 14, 2007 IP
  2. WebGyver

    WebGyver Guest

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    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.
     
    WebGyver, Jul 14, 2007 IP
  3. nabi bux

    nabi bux Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks for reply definately i press space bar but but not checked or uncheked
    the fucus still remain at submit button:D
     
    nabi bux, Jul 15, 2007 IP