Showing posts with label pressing. Show all posts
Showing posts with label pressing. Show all posts

Monday, March 26, 2012

AJAX Automatic label updating while typing text

Hi,

I'm testing AJAX out and I have a question. Is it possible to display the tex that I write in a textbox onto a label without pressing a button? So when I type a "1" in the textbox, I want to see the "1" directly on the label aswell.

Thanks,
Jeff

Use javascript. Add an onchange function to your textbox.

<input type="text" onchange="WriteMe(this);" />
<asp:Label ID="lblMesgArea" Text="" runat="server" />

JavaScript Function:

function WriteMe(Mesg)
{
var mesgArea = document.getElementById('" & Me.lblMesgArea.ClientID & "');
mesgArea.value = mesgArea.value + Mesg.value;
}

There are other ways to do it too. This the first thing that comes to my mind =)

WS

Ajax AutoCompleteExtender causing validators to fire

Hi,

I'm having a problem with validators firing whenever I select an item in a field extended with autocomplete (I guess pressing the enter key is trying to submit the form?). How can I get around this?

Thanks

The autocomplete extender does not stop the enter key event from propagating to the form which causes the validators to kick in. I think we would like to stop that and let the event propagate if an item has been selected. Could you please open a bug on this? Thanks.