Cheap Plane Tickets - Debt Consolidation - Health 2007 - Internet Advertising - Deaf Topics

PDA

View Full Version : Show/Hid div


Fracisc
Feb 27th 2009, 11:14 pm
I have 3 radio buttons.

1. - when checked, should hide both divs
2. - when checked, should display div 2 (only)
3. - when checked, should display div 3 (only)

I used
function abox(state)
{
document.getElementById('abox').style.display = state;
}

But when using this, the prompter do not want to move to the 2nd text box, when I click into it, it goes to the first textbox. It is something like on click go to the first item.

Vooler
Feb 28th 2009, 12:47 am
set id property of text box input:

<input type="text" id="abc" ..............>

to set focus use
document.getElementById("abc").focus();

Fracisc
Feb 28th 2009, 5:17 am
Thanks, I have already managed to do the task. :)