News Flash:
New Version of ShopClass theme 1.4.0 is Released on 13 JUNE 2018, Please upgrade your installation.

How to make required the Categories field of inc.search.php

A place to talk about anything related to Tuffclassified theme in general. This is not the place to ask support questions.
Locked
robbie.kein
Noob
Posts: 8
Joined: Thu Dec 10, 2015 12:18 pm
Been thanked: 1 time

How to make required the Categories field of inc.search.php

Post by robbie.kein » Mon Jun 06, 2016 9:21 am

Hi,
I need your help to make required the Categories field of inc.search.php file. I tried it with this $ ('# sCategory'). prop ( 'required', true); and other jquery codes, but without achieving the desired result. The code $ ('# sCategory'). prop ( 'required', true); It does not work for the Safari browser.
I thank you in advance

Regards

User avatar
tuffadmin
Site Admin
Posts: 1236
Joined: Tue Jan 29, 2013 7:31 pm
Has thanked: 33 times
Been thanked: 111 times

Re: How to make required the Categories field of inc.search.

Post by tuffadmin » Wed Jun 08, 2016 4:53 am

Please share your site url.
No support for unnecessary PM, use forum for support queries.
Please give us good review if you bought our theme from Osclass Market

robbie.kein
Noob
Posts: 8
Joined: Thu Dec 10, 2015 12:18 pm
Been thanked: 1 time

Re: How to make required the Categories field of inc.search.

Post by robbie.kein » Wed Jun 08, 2016 1:26 pm

Hi,
my site is not yet online. It is localhost.
I use the version tuffclassifieds 3.4.

Thx

Regards

User avatar
tuffadmin
Site Admin
Posts: 1236
Joined: Tue Jan 29, 2013 7:31 pm
Has thanked: 33 times
Been thanked: 111 times

Re: How to make required the Categories field of inc.search.

Post by tuffadmin » Thu Jun 09, 2016 5:24 pm

robbie.kein wrote:Hi,
my site is not yet online. It is localhost.
I use the version tuffclassifieds 3.4.

Thx

Regards
Did you get in javascript related error in web console. Is it working in other browser?
No support for unnecessary PM, use forum for support queries.
Please give us good review if you bought our theme from Osclass Market

robbie.kein
Noob
Posts: 8
Joined: Thu Dec 10, 2015 12:18 pm
Been thanked: 1 time

Re: How to make required the Categories field of inc.search.

Post by robbie.kein » Wed Jun 15, 2016 8:45 am

Hi,
it works for all other browsers (Mozilla, Chrome, Opera, IE) with whom I have made some tests. The only browser for which it does not work is Safari. For all other browsers if I press "Search" without selecting a category appears in the browser window the message "Please select an item in the list"
Regards

User avatar
tuffadmin
Site Admin
Posts: 1236
Joined: Tue Jan 29, 2013 7:31 pm
Has thanked: 33 times
Been thanked: 111 times

Re: How to make required the Categories field of inc.search.

Post by tuffadmin » Thu Jun 16, 2016 3:57 am

Share your js code and tell how you implemented it?
No support for unnecessary PM, use forum for support queries.
Please give us good review if you bought our theme from Osclass Market

robbie.kein
Noob
Posts: 8
Joined: Thu Dec 10, 2015 12:18 pm
Been thanked: 1 time

Re: How to make required the Categories field of inc.search.

Post by robbie.kein » Thu Jun 16, 2016 7:06 am

Hi,
I used different codes but they usually do not even work with other browsers.
The two methods that have worked well with all browsers except Safari are these two:
1) tfcform.php where I added required for categories
class tfcForm extends Form
{
static public function category_select($categories, $category, $default_item = null, $name = "sCategory")
{
echo '<select title="Seleziona una categoria" class="form-control required" name="' . $name . '" id="' . $name . '" required>';

2) inc.search.php this code

<script type="text/javascript">
$ ('# sCategory'). prop ( 'required', true);
</script>

I want this field to be required. I tried so many other codes but without the desired result.

I failed to find a solution to become mandatory this field I have also tried to disable the "SEARCH" button if the dropdown field of the categories were not selected. But without obtaining a satisfactory and professional result
Thanks for your help

Regards

robbie.kein
Noob
Posts: 8
Joined: Thu Dec 10, 2015 12:18 pm
Been thanked: 1 time

Re: How to make required the Categories field of inc.search.php

Post by robbie.kein » Fri Jul 22, 2016 8:19 am

Hi,
I have to understand it is not possible to turn the Categories field, also a mandatory field for the Safari browser?
Thank you

Locked