Jump to content

ClientSide vs ServerSide TuniEdit issue


vbdavie

Recommended Posts

This is a little complicated to explain. But I'm sure you'll get the idea once you think about it for a minute or so.

Imagine two TuniEdit fields on a form (like a login screen). And imagine the 2nd field (password) has it's contents selected when the cursor is placed inside of it. That way if it contained old text, it would be selected so that as you start to type, the older contents are essentially removed. Okay. This seems like a normal thing to do.

Now, let's break this down...

1. The TuniEdit field has an OnEnter event. This event occurs on the Server-Side. Right?

2. As the user types, that is Client-Side. Right?

Everything so far is obvious and makes sense I think. Here's the issue.

  • I type stuff in the username field (fine)
  • I press tab to move to the password field (fine)
  • The Server-Side code starts to select all the text (fine)
  • The Server-Side code finishes selecting all the text (fine)
  • I type in my password (fine)

Okay, that's how it's supposed to work and it does... MOST of the time. Now, let's pretend that you are on a SLOW server where the server-side code executes slowly. Here's what happens.

  • I type stuff in the username field (fine)
  • I press tab to move to the password field (fine)
  • The Server-Side code starts to select all the text (fine)
  • I type in my password real fast
  • The Server-Side code finishes selecting all the text (fine)
  • Now my password has the first few characters removed (NOT FINE)

So what's happening is that the moment my cursor is tabbed into the password field, a server-side code starts to execute WHILE I AM TYPING in the browser. So after I get done typing about 2 or 3 characters, I see those characters get HIGHLIGHTED. lololol Because it took about 100ms to do the server-side code which says to field.SelectAll. So as I am in the middle of typing, I suddenly see my text highlighted and then whatever was highlighted gets removed as I continue typing. hehehehehe

I hope you see the situation. The client-side operates at full speed WITHOUT regard for the server-side code that is executing.

I know I must be ignorant on something. Can you help me please?

Thanks

DAvie

Link to comment
Share on other sites

Yeah, after I sent it, I was staring at the properties again and noticed that one "SelectOnFocus". Sorry for my ignorance.

But what if there was no such property, OR I had the server-side doing something more complex... like maybe forcing alternating case of the field.   So      mypassword      would become    MyPaSsWoRd

Since there's no simple property for that, how would I go about synching the server-side and the client-side so that the user can't enter text UNTIL the server-side event is completed.

Thanks bunches

DAvie

Link to comment
Share on other sites

  • 4 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...