The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
putting default val...
 
Notifications
Clear all

putting default value for comments not replies

10 Posts
2 Users
0 Reactions
1,815 Views
Posts: 8
 Roah
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@roah)
Active Member
Joined: 5 years ago
[#2118]

Hello 
I want to put a default value to comments,  just for comments not replies

and not placeholder 

it's a value 

can you help me please?


9 Replies
Asti
Posts: 8215
 Asti
Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@asti)
Illustrious Member
Joined: 8 years ago

Hi @roah,

I'm really sorry, but there isn't an easy solution we can provide you. You should write custom JS codes for this kind of customization. 


Reply
Posts: 8
 Roah
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@roah)
Active Member
Joined: 5 years ago

can help me to make attachments as "required" just in my comments ???


Reply
4 Replies
Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8215
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@roah,

Use this JS code:

jQuery(document).ready(function ($) {
$(document).on('click', '.wc_comm_submit', function (e) {
if (!($(this).parents('.wpd_comm_form').find('.wmu-attachments-ids') && $(this).parents('.wpd_comm_form').find('.wmu-attachments-ids').val())) {
wpdiscuzAjaxObj.setCommentMessage('Attachment is required');
e.preventDefault();
e.stopImmediatePropagation();
return false;
}
});
});

Just make sure this JS code is being loaded before the wpDiscuz js files. 


Reply
 Roah
(@roah)
Joined: 5 years ago

Active Member
Posts: 8
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@asti

please can you update this code to make required attachments just for comments not replies?
I tried to put (.wpd-main-form-wrapper) as a parent class but that didn't work 

thank you very much


Reply
Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8215
Asti
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@roah,

Try this one:

jQuery(document).ready(function ($) {
  $(document).on('click', '.wc_comm_submit', function (e) {
    if (!($(this).parents('.wpd_main_comm_form').find('.wmu-attachments-ids') && $(this).parents('.wpd_main_comm_form').find('.wmu-attachments-ids').val())) {
      wpdiscuzAjaxObj.setCommentMessage('Attachment is required');
      e.preventDefault();
      e.stopImmediatePropagation();
      return false;
    }
  });
});

Reply
 Roah
(@roah)
Joined: 5 years ago

Active Member
Posts: 8
Asti
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@asti

It doesn't work 
still require the attachments 😥 


Reply
Asti
Posts: 8215
 Asti
Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@asti)
Illustrious Member
Joined: 8 years ago
Posted by: @asti

Just make sure this JS code is being loaded before the wpDiscuz js files. 

What about this condition? Are you sure this is made? 


Reply
2 Replies
 Roah
(@roah)
Joined: 5 years ago

Active Member
Posts: 8
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@asti

how exactly can I do that ?

I put this code in child theme and in Header and Footer manager Code plugin and Still doesn't work


Reply
Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8215
Asti
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@roah,

You can create some new JS file, put the code in the file, then add the created file in the header of your active theme. If it still doesn't work, keep the changes and leave some example URL to allow us to check the issue. 


Reply
Share: