示例#1
0
function nm_script()
{
    ?>
<script type="text/javascript">
	$(function () {
		$('<?php 
    echo dd_nm_id();
    ?>
').bind('cut copy paste', function (e) {
			e.preventDefault();
			//$(this).addClass('error');
			$(this).attr('placeholder', '<?php 
    _e('Paste is not allowed', 'nm_copypaste_plugin');
    ?>
');
		});
	});
</script>
<style type="text/css">
	.error {
		border:1px solid #ff0000!important;
	}
</style>
<?php 
}
?>
</h2>
        <form action="<?php 
echo osc_admin_render_plugin_url('nm_copypaste_plugin/admin/settings.php');
?>
" class="form-horizontal" method="post">
          <input type="hidden" name="nomoreoption" value="nomoresettings" />
          <fieldset>
          <div class="control-group">
            <label class="control-label"><strong><?php 
_e('Enter field id/class name to disable paste option', 'nm_copypaste_plugin');
?>
</strong></label>
            <div class="controls">
                <textarea rows="6" name="nm_id"><?php 
echo osc_esc_html(dd_nm_id());
?>
</textarea>
            </div>
            <span class="help"><?php 
_e('Add more id/class names by adding comma', 'nm_copypaste_plugin');
?>
.</span>
          </div>
         </fieldset>
          
          <div class="form-actions">
            <input type="submit" value="<?php 
_e('Save changes', 'nm_copypaste_plugin');
?>
" class="btn btn-submit">