Advertisement:

Author Topic: Mandatory fields in item with error massage  (Read 91 times)

Robin

  • Newbie
  • *
  • Posts: 23
Mandatory fields in item with error massage
« on: September 04, 2019, 01:05:05 pm »
Hi guys, I would be very grateful for any help.

Namely, I have a few things changeable in the item-post script.

Now I have fields which are required fields but they are not.

And I do not know how to get these to which one can help me with the experience

gnolino

  • Jr. Member
  • **
  • Posts: 56
Re: Mandatory fields in item with error massage
« Reply #1 on: September 05, 2019, 01:55:35 pm »
Do you want modify required fields into item-post.php?
« Last Edit: September 05, 2019, 11:19:40 pm by gnolino »

Robin

  • Newbie
  • *
  • Posts: 23
Re: Mandatory fields in item with error massage
« Reply #2 on: September 06, 2019, 09:46:35 pm »
no that's not that what I want but I have to now all the files that I have to chance something for an Massage if there standing nothing in

elizabeth

  • Jr. Member
  • **
  • Posts: 80
Re: Mandatory fields in item with error massage
« Reply #3 on: September 06, 2019, 11:31:07 pm »
Hi guys, I would be very grateful for any help.

Namely, I have a few things changeable in the item-post script.

Now I have fields which are required fields but they are not.

And I do not know how to get these to which one can help me with the experience

Your message isnt very clear. I guess you added some custom fields in the item post page and you want those fields to be required..
If yes then you have to validate those fields in file osc-includes/osclass/frm/Item.form.class.php

Search for code for form validation something like that:

Code: [Select]
contactEmail: {
 required: true,
  email: true

then bellow in the messages you have to add:

Code: [Select]
contactEmail: {
                    required: "<?php echo osc_esc_js(__("Email: this field is required")); ?>.",
                    email: "<?php echo osc_esc_js(__("Invalid email address")); ?>."
                },

Thats an example to get an idea. If you take a closer look in the file you will understand how it works.

Hope that this will help you.


« Last Edit: September 06, 2019, 11:34:15 pm by elizabeth »