Question: I want to add some custom text area to add admin comment for orders that added by front end. and i want to save it to order table from ajax. I'm trying to create custom module but it wasn't successful.

I changed the admin template file to add that (Urgent Comment, Is
Urgent fields) but I couldn't to save it using ajax.

![enter image description here](https://i.stack.imgur.com/tWiP7.png)

Answer: 
finally i did it from changing the core files.

i added below code to info.phtml file

```
<form id="cus_com" >
            <div class="entry-edit">
                <div class="entry-edit-head">
                    <h4 class="icon-head head-payment-method"><?php  echo Mage::helper('sales')->__('Urgent Comment') ?></h4>
                </div>
                <fieldset>
                    <span class="field-row">
                        <label class="normal" for="urgent_comment"><?php echo Mage::helper('sales')->__('User Note') ?></label>
                        <textarea name="urgentComment" rows="3" cols="5" style="height:6em; width:99%;" id="urgentComment" >
                            <?php echo $_order->getUserNote(); ?>
                        </textarea>
                    </span>
                    <input name="isUrgent" type="checkbox" id="isUrgent" value="<?php if ($_order->getUserNote() == 1) {
                                echo 'yes';
                            }  ?>" />
                    <label> <?php echo Mage::helper('sales')->__('Is Urgent') ?></label><br />
                    <button type="button" align="right" title="<?php echo "Submit Comment" ?>" id="bb" onClick="handlerFunction()" ><span><span><?php echo "Submit Comment" ?></span></span></button>
                    <script type="text/javascript">
                        function handlerFunction(){
                            var params = {};
                            //var   shipping = $('shipping-fields').serialize(true);
                            // params['shipping'] = Object.toJSON(shipping);
                            params['order_id'] = <?php echo $_order->getId() ?>;
                            params['urgentComment'] = $('urgentComment').value;
                            var n = $('isUrgent').value;
                            if(n=='yes'){
                                params['isUrgent']=1;
                            }else{
                                params['isUrgent']=0;
                            }

                            new Ajax.Request('<?php echo Mage::getModel('adminhtml/url')->getUrl('orderedit/order/saveCommnet') ?>', {
                                method: 'post',
                                parameters: params,
                                onSuccess: function(transport) {
                                    $('urgentComment').innerHTML = transport.responseText;              
                                }
                            }); 
                        }
                    </script>
                </fieldset>
             </div>
            </form>

```

and i added this to order controller public function saveCommnetAction(){

```
$order = $this->_initOrder();
    $comment= $this->getRequest()->getPost('urgentComment');
    $is_urgent = $this->getRequest()->getPost('isUrgent');

    $order->setUserNote($comment)
          ->setIsUrgent($is_urgent);
    $order->save();

}

```

its working. thanks
this is the template file 

> 
> app/design/adminhtml/default/default/template/sales/order/view/tab/info.phtml
> 
> 
> 

this is the controller.its an another custom module controller class that extend Mage\_Adminhtml\_Controller\_Action 

> 
> app/code/local/mynamespace/OrderEdit/controllers/OrderController.php
> 
> 
>