The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Reason For Editing

View previous topic View next topic Go down

Reason For Editing

Post by smejker on January 27th 2015, 9:47 am

In this post:


Code:
http://help.forumotion.com/t138033-how-to-force-users-to-fill-in-reason-for-editing?highlight=reason

I find this script:

Code:
$(function() {
  var rsmsg = '*You Must Enter A Reason To Send';
if($('input[name="edit_reason"]').val() == ""){
        $('input[name="post"]').attr('disabled','disabled');
        $('input[name="edit_reason"]').after(' <br><span id="edrmsg" style="color:red;font-weight:bolder;">'+rsmsg+'</span>');
    }
    else{
        $('input[name="post"]').removeAttr('disabled');
        $('#edrmsg').remove();
    }
$('input[name="edit_reason"]').keyup(function(){
  if($('input[name="edit_reason"]').val() == ""){
        $('input[name="post"]').attr('disabled','disabled');
        $('input[name="edit_reason"]').after(' <br><span id="edrmsg" style="color:red;font-weight:bolder;">'+rsmsg+'</span>');
    }
    else{
        $('input[name="post"]').removeAttr('disabled');
        $('#edrmsg').remove();
    }
}) 
});

It's work perfectly, but i have queston... When is first edited we must to write reason for editing... but when we open it for second, or third time there is no option to must write reason for editing...

So i wonder how to fix this?

Thanks in Advance...

Regards & Respect!

smejker
Forumember

Male Posts : 158
Reputation : 3
Language : serbo-croatian/english/macedonian/bulgarian

http://smejker@yahoo.com

Back to top Go down

Re: Reason For Editing

Post by _Twisted_Mods_ on January 27th 2015, 3:35 pm

yea first time i wrote that i made it check to see if the reason box was empty so i redone it and now it gets the text of the reason box and doesn't let you submit until the reason has been changed


Code:
  $(function() {
  var rsmsg = '*You Must Enter A Reason To Send';
         var oldmsg = input[name="edit_reason"]').val();
  if($('input[name="edit_reason"]').val() == oldmsg){
  $('input[name="post"]').attr('disabled','disabled');
  $('input[name="edit_reason"]').after(' <br><span id="edrmsg" style="color:red;font-weight:bolder;">'+rsmsg+'</span>');
  }
  else{
  $('input[name="post"]').removeAttr('disabled');
  $('#edrmsg').remove();
  }
  $('input[name="edit_reason"]').keyup(function(){
  if($('input[name="edit_reason"]').val() == oldmsg){
  $('input[name="post"]').attr('disabled','disabled');
  $('input[name="edit_reason"]').after(' <br><span id="edrmsg" style="color:red;font-weight:bolder;">'+rsmsg+'</span>');
  }
  else{
  $('input[name="post"]').removeAttr('disabled');
  $('#edrmsg').remove();
  }
  })
      });

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Re: Reason For Editing

Post by smejker on January 30th 2015, 10:46 am

Hmm, That is not what I looking for... Anyway Thanks _Twisted_Mods_

smejker
Forumember

Male Posts : 158
Reputation : 3
Language : serbo-croatian/english/macedonian/bulgarian

http://smejker@yahoo.com

Back to top Go down

Re: Reason For Editing

Post by smejker on February 2nd 2015, 3:52 pm

BUUUUUUMMMMPPPPP!!! Very Happy

smejker
Forumember

Male Posts : 158
Reputation : 3
Language : serbo-croatian/english/macedonian/bulgarian

http://smejker@yahoo.com

Back to top Go down

Re: Reason For Editing

Post by _Twisted_Mods_ on February 15th 2015, 8:40 pm

not really sure what your asking the code i provided should do what you asked

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum