I am trying to set up an \[code\]Add Question\[/code\] button function but I am off to a bad start. I am receiving a error stating:TypeError: form.questionText is undefinedWhat am I doing wrong?\[code\] <script type="text/javascript"> function insertQuestion(form) { var questionarea = (form.questionText.length) ? form.questionText[0] : form.questionText; } </script><table id="question"><tr> <td>Question:</td> <td> <textarea class="questionTextArea" id="mainTextarea" rows="5" cols="40" name="questionText"></textarea> </td></tr></table> <form id="QandA" action="insertQuestion.php" method="post"> <table id="questionBtn" align="center"> <tr> <th> <input id="addQuestionBtn" name="addQuestion" type="button" value="http://stackoverflow.com/questions/14515806/Add Question" onClick="insertQuestion(this.form)" /> </th> </tr> </table> </div> <hr/> <table id="qandatbl" align="center" cellpadding="0" cellspacing="0" border="0"> <thead> <tr> <th width="13%" class="question">Question</th> </tr> </thead> </table> <div id="qandatbl_onthefly_container"> <table id="qandatbl_onthefly" align="center" cellpadding="0" cellspacing="0" border="0"> <tbody></tbody> </table> </div> </form>\[/code\]