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 Tue Jan 27, 2015 2: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!
avatar
smejker
Forumember

Male Posts : 159
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 Tue Jan 27, 2015 8:35 am

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();
  }
  })
      });
avatar
_Twisted_Mods_
Helper
Helper

Male Posts : 2032
Reputation : 302
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Re: Reason For Editing

Post by smejker on Fri Jan 30, 2015 3:46 am

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

Male Posts : 159
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 Mon Feb 02, 2015 8:52 am

BUUUUUUMMMMPPPPP!!! Very Happy
avatar
smejker
Forumember

Male Posts : 159
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 Sun Feb 15, 2015 1:40 pm

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

Male Posts : 2032
Reputation : 302
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