0 Replies Latest reply on Feb 5, 2009 4:40 AM by hoppe11

    Send loadVars on ENTER

    hoppe11 Level 1
      I got a input which on a ENTER keystroke will send. The problem is that if maxChars is set and the field is full you can't submit.

      function cnstr_broadcast_send(x, y, width, maxChars)
      {
      var mc = _root.createEmptyMovieClip('mcBroadcast_send', _root.getNextHighestDepth());
      var txt = cnstr_input(x, y, width, clrWhite, clrBlack, mc, 'txtBroadcast', maxChars);

      txt.multiline = true;
      txt.onChanged = function()
      {
      if(this.text.indexOf('\r') > -1)
      {
      var frmPost = new LoadVars();
      frmPost._form = 'broadcast';
      frmPost.msg = this.text;
      frmPost.send(ExternalInterface.call('get_url', 'iframe_timeout'), 'iframe_timeout', 'POST');

      this.text = '';
      }
      }
      }