提交换行和空格的一段代码
<script type="text/javascript"> $(function(){ $("#myform").submit(function(){ text = $("#menu").val(); text = text.replace(/\r/g," "); text = text.replace(/\n/g,"\n"); $("#menu").val(text); //alert($("#menu").text()); }); }); </script>
<script type="text/javascript"> $(function(){ $("#myform").submit(function(){ text = $("#menu").val(); text = text.replace(/\r/g," "); text = text.replace(/\n/g,"\n"); $("#menu").val(text); //alert($("#menu").text()); }); }); </script>