views:

28

answers:

0

Hello, I have a folloowing: textarea and button, I would like to fill it by predefined text and in meantime make a syntax highlighting with CodeMirror:

$('#query1').button()
                .click(function() {
                    $('#queryText').val(<?php echo $queryArray[0];?>);
                }

Then:

<form id="queryFrom" name="queryBox"
    action="processquery.php" method="get">
        <textarea id="queryText"
    name="queryText" cols="120" rows="30">
    </textarea>
    </form> 
<button id="query1">Query1</button>
<script type="text/javascript" src="js/code/js/codemirror.js"></script>

<script type="text/javascript">

var editor = CodeMirror.fromTextArea('queryText', {
      height: "150px",
      parserfile: "parsesql.js",
      path: "js/code/js/",
      stylesheet: "js/code/css/sqlcolors.css",
      textWrapping: true
    });
</script>

unfortunately the text from button does not fill the area if CodeMirror is enabled. What is the problem?

kind regards Arman.