The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Reason For Editing

2 posters

Go down

Reason For Editing Empty Reason For Editing

Post by smejker Tue 27 Jan 2015 - 9:47

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
smejker
Forumember

Male Posts : 167
Reputation : 4
Language : serbo-croatian/english/macedonian/bulgarian

Back to top Go down

Reason For Editing Empty Re: Reason For Editing

Post by _Twisted_Mods_ Tue 27 Jan 2015 - 15:35

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_
_Twisted_Mods_
Helper
Helper

Male Posts : 2083
Reputation : 336
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Reason For Editing Empty Re: Reason For Editing

Post by smejker Fri 30 Jan 2015 - 10:46

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

Male Posts : 167
Reputation : 4
Language : serbo-croatian/english/macedonian/bulgarian

Back to top Go down

Reason For Editing Empty Re: Reason For Editing

Post by smejker Mon 2 Feb 2015 - 15:52

BUUUUUUMMMMPPPPP!!! Very Happy
smejker
smejker
Forumember

Male Posts : 167
Reputation : 4
Language : serbo-croatian/english/macedonian/bulgarian

Back to top Go down

Reason For Editing Empty Re: Reason For Editing

Post by _Twisted_Mods_ Sun 15 Feb 2015 - 20:40

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

Male Posts : 2083
Reputation : 336
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Back to top


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