Support Forums - Classified Ads Script Osclass
Osclass theme support => Free themes => Patricia Osclass Responsive Theme => Topic started by: bwillnz on April 17, 2017, 08:28:58 AM
-
Hello,
I want to disable the location dropdowns on my post item form.
I'm using the Patricia theme, and in the <script> area I have commented out the dropdowns onchange functions, and there was this part..
//DISABLE NAME & EMAIL INPUTS FOR LOGGED IN USER
$('.add_item .seller_info.logged input#contactName, .add_item .seller_info.logged input#contactEmail').prop('disabled', true);
I have added the 2 select boxes into here to look like this..
//DISABLE NAME & EMAIL INPUTS FOR LOGGED IN USER
$('.add_item .seller_info.logged input#contactName, .add_item .seller_info.logged input#contactEmail, .add_item .seller_info.logged select#regionID, .add_item .seller_info.logged select#cityID').prop('disabled', true);
But the select boxes are still enabled. Can any one help me to disable them please.
-
@bwillnz
You mean add attribute disabled to them or remove them?
-
I was hoping to have them grayed out but with the values that the user has set for their location in their profile, I have tried a few different things using .prop and .attr and also using .regionID, #regionID but I can't get them to disable.
Another option would be to replace with labels or disabled text boxes instead of the select dropdown.
My end result of the modifications will be so the location of the classifieds is set to where the user is based, so if they change the location in the profile it will also change on their listings.
Thanks
-
@bwillnz
You need to set readme to true. If you set it to disabled, on form submit it will not be used.
$('input').attr('readme', true);
That should work.