tags:

views:

353

answers:

1
Ext.onReady(function(){  
    if (Ext.get('ctl00_ContentBody_txtCM').dom.value == "") 
   { 
      Ext.MessageBox.alert("Status", "You have input CM!", function()
       {  
             Ext.get('ctl00_ContentBody_txtCM').focus();                 

        }     
        );             
   }

when submit button,it postback server before.Please help me.I using asp.net

Thanks

A: 

I don't think this has anything to do with your submit button. If I'm reading this right, you fire this function:

function(){  
if (Ext.get('ctl00_ContentBody_txtCM').dom.value == "") 
{ 
  Ext.MessageBox.alert("Status", "You have input CM!", function()
   {  
         Ext.get('ctl00_ContentBody_txtCM').focus();                 

    }     
    );

Exactly once, when the Ext library is done loading. I think you should double-check your Javascript and the Ext API. For starters, remove the if() statement and try to get the message box to fire without it.

JoshJordan