...

View Full Version : Select Radio Button Onload (newbie)?



mOrloff
03-16-2009, 09:24 PM
I am trying to have a RB selected by default, and my skills are quite lacking.

This is what I've come up with so far.
I must be missing something 'cuz it aint workin'.:)

function setValue(){
document.partSrch.type[0].checked=true;
}
body.onload = setValue();

And a snippet of my form:

<form id="eduPartSearch" name="partSrch" method="post" action="">
PartNumber <input type="radio" name="type" value="pn" />
Description<input type="radio" name="type" value="desc" />
Where am I going wrong?

~ Mo

tomws
03-16-2009, 11:38 PM
Does it need to be Javascript? Why not plain old html?


<input type="radio" name="something" id="something" value="someValue" checked="checked" /> Some Value

mOrloff
03-16-2009, 11:57 PM
... Why not plain old html?

Because I forgot about that :o.

Thanks-a-bunch.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum