Create checked radio button dynamically

Posted by: E-Surfers Weblog, on 21 Sep 2006 | View original | Bookmarked: 0 time(s)

I meet some trouble when creating radio buttons through javascript. My code is something like this: function createRadioButton(elt_name, elt_value, elt_label, is_selected) { var inputElement = document.createElement('input'); inputElement.setAttribute('type', 'radio'); inputElement.setAttribute('name', elt_name); inputElement.setAttribute("value", elt_value); var func = new Function("alert(this.value + ' is selected!')"); inputElement.onclick = func; if (is_selected)...

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: ASP.NET | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 3506 | Hits: 127

Similar Posts

  • Code Review Singleton Pattern Issues more
  • RedirectButton - Redirect Users With the Click of a Button more
  • Javascript Array Fun more
  • Assembly Loading across AppDomains more
  • Windows Forms Creating an access key more
  • Automated Attendant with the OCSDK Wrapper and WPF more
  • Return a List<T> or a ObservableCollection<T> more
  • Popup Control more
  • Dynamically creating and destroying containers more
  • Dynamically Creating User Controls That Fire Events Back To You more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD