Jump to content

jQuery question - webkit select tag issue


mike77
 Share

Recommended Posts

I just wanted to know if you know the solution to something I'm stuck with.

I have a select in my form which I want to:

1. disable when someone chooses and clicks the option in it

2. activate it if someone clicks the button and set the first select option (empty option in my case).

The code looks like this:

var selectDisable = {};
selectDisable.select = function() {
   $('form.visit_form option').click(function() {
       $('form.visit_form select').attr('disabled', 'disabled');
   });

   $('input.cancelChoice').click(function() {
       $('form.visit_form select').removeAttr('disabled').val($('form.visit_form select option:first'));
   })
};

All seems OK however disabling select dosen't work in chrome and safari. I tried to change "attr" method to "prop" also change the second argument from "disable" to "true" but non of this works.

Has anyone encountered this kind of issue?

Link to comment
Share on other sites

My suggestion:

- Pub ("real" offtopic)

- Web development in general (not PW related)

-- Javascript / jQuery

-- PHP / MySQL

-- HTML / CSS

-- Web design (nice sites, best practice, tools etc.)

-- other

- ProcessWire in the media (not one thread for all publications but one thread each, gets overcrowded otherwise)

Link to comment
Share on other sites

 Share

×
×
  • Create New...