Osclass Support Forums

Osclass theme support => Veronika Osclass Responsive Theme => Topic started by: njsb777 on May 02, 2017, 12:48:03 AM

Title: How can I place transaction and condition fields as required fields?
Post by: njsb777 on May 02, 2017, 12:48:03 AM
How can I place transaction and condition fields as required fields? When registering a new ad.
Title: Re: How can I place transaction and condition fields as required fields?
Post by: MB Themes on May 02, 2017, 08:35:37 AM
@njsb
In item-post.php you need to add code in section:
Code: [Select]
$("form[name=item]").validate({
with ID of input you want to be required (check existing codes here to find pattern).
Title: Re: How can I place transaction and condition fields as required fields?
Post by: njsb777 on May 03, 2017, 07:13:52 PM
Add the following codes, but it does not work. Can you help me? I do not have much knowledge in php.


<?php if(strpos($required_fields, 'Transaction') !== false) { ?>
          Transaction: {
            required: true
          },
 <?php } ?>


       
"Transaction[<?php echo osc_current_user_locale(); ?>]": {
            required: "<?php echo osc_esc_js(__('Transaction: this field is required.', 'veronika')); ?>",
            minlength: "<?php echo osc_esc_js(__('Transaction: select transaction from transaction field.', 'veronika')); ?>"
},
Title: Re: How can I place transaction and condition fields as required fields?
Post by: Ivanko on May 03, 2017, 09:22:33 PM
example for Transaction

in item-post.php

1. where you have
Code: [Select]
$("form[name=item]").validate({add:
Code: [Select]
<?php if(strpos($required_fields'transaction') !== false) { ?>
           sTransaction: {
            required: true
          },
           <?php ?>

2. where you have
Code: [Select]
messages: {add:
Code: [Select]
<?php if(strpos($required_fields'transaction') !== false) { ?>
          sTransaction: {
            required: "<?php echo osc_esc_js(__('Transaction: this field is required.''veronika')); ?>"
          },
          <?php ?>

3. in admin panel in Required Fields on Publish add world transaction



etc.....
Title: Re: How can I place transaction and condition fields as required fields?
Post by: njsb777 on May 03, 2017, 10:14:42 PM
@Ivanko

wooow... Thank you very much, that's what I needed.

It worked perfectly!
Title: Re: How can I place transaction and condition fields as required fields?
Post by: kriskoyk on April 20, 2020, 09:05:24 PM
example for Transaction

in item-post.php

1. where you have
Code: [Select]
$("form[name=item]").validate({add:
Code: [Select]
<?php if(strpos($required_fields'transaction') !== false) { ?>
           sTransaction: {
            required: true
          },
           <?php ?>

2. where you have
Code: [Select]
messages: {add:
Code: [Select]
<?php if(strpos($required_fields'transaction') !== false) { ?>
          sTransaction: {
            required: "<?php echo osc_esc_js(__('Transaction: this field is required.''veronika')); ?>"
          },
          <?php ?>

3. in admin panel in Required Fields on Publish add world transaction



etc.....


Ivanko,

Can you write in more detail what we do in step 3?

Title: Re: How can I place transaction and condition fields as required fields?
Post by: MB Themes on April 21, 2020, 08:58:16 AM
@kriskoyk
You go to theme settings and in input "Required fields on publish" write "transaction" as well
Title: Re: How can I place transaction and condition fields as required fields?
Post by: kriskoyk on May 04, 2020, 04:23:56 PM
The issue has been resolved.
Title: Re: How can I place transaction and condition fields as required fields?
Post by: officela on July 12, 2020, 09:22:15 PM
example for Transaction

in item-post.php

1. where you have
Code: [Select]
$("form[name=item]").validate({add:
Code: [Select]
<?php if(strpos($required_fields'transaction') !== false) { ?>
           sTransaction: {
            required: true
          },
           <?php ?>

2. where you have
Code: [Select]
messages: {add:
Code: [Select]
<?php if(strpos($required_fields'transaction') !== false) { ?>
          sTransaction: {
            required: "<?php echo osc_esc_js(__('Transaction: this field is required.''veronika')); ?>"
          },
          <?php ?>

3. in admin panel in Required Fields on Publish add world transaction



etc.....

Is it possible to do the same with images?
can you provide code?