0
<head>
\t <script language='javascript' type='text/javascript'>
\t \t function insertTemplate() {
\t \t \t console.log('something is coming out');
\t \t \t if (document.getElementById('template').checked) {
\t \t \t \t var test = "lore ipsum";
\t \t \t \t document.getElementById('message') = test;
\t \t \t \t alert(test);
\t \t \t }
\t \t \t else (
\t \t \t \t var nothing = '';
\t \t \t \t document.getElementById('message') = nothing;
\t \t \t)
\t \t }
\t </script>
</head>
<body>
\t <form class='form-horizontal' role='form' method='post'>
\t \t {{ csrf_field() }}
\t \t <input type='text' name='address'><br>
\t \t <input type='text' name='subject'><br>
\t \t <input type='checkbox' name='template' id='template' onclick = "insertTemplate()"> Insert in template</br>
\t \t <input type='text' name='message' id = 'message' style='width:500px;height:500px;'><br>
\t \t <button type='submit'>Submit</button>
\t </form>
</body>
別人或許應該用花括號寫 –