SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Threaded View

  1. #1
    SitePoint Guru okrogius's Avatar
    Join Date
    Mar 2002
    Location
    US
    Posts
    622
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    formField.value='x'; for a <select>

    I currently have this:
    Code:
      			var select = xGetElementById('theid');
      			for (var i = 0; i < select.length; i++) {
     				if (select.options[i].value == desiredValue) {
     		 		select.options[i].selected = true;
      				} else {
     		 		select.options[i].selected = false;
      				}
      			}
    But it only works in IE. Firefox js console complains that select doesn't have any properties. Any ideas?
    Last edited by Codename49; Mar 23, 2004 at 17:10.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •