*

bwillnz

  • *
  • 3 posts
Disable location select boxes in post item
« 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..


Code: [Select]
//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..


Code: [Select]
//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.

*

MB Themes

Re: Disable location select boxes in post item
« Reply #1 on: April 18, 2017, 03:24:17 PM »
@bwillnz
You mean add attribute disabled to them or remove them?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

bwillnz

  • *
  • 3 posts
Re: Disable location select boxes in post item
« Reply #2 on: April 18, 2017, 07:15:08 PM »
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

*

MB Themes

Re: Disable location select boxes in post item
« Reply #3 on: April 19, 2017, 10:47:45 AM »
@bwillnz
You need to set readme to true. If you set it to disabled, on form submit it will not be used.
Code: [Select]
$('input').attr('readme', true);
That should work.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots