PC Review


Reply
Thread Tools Rate Thread

AJAX and textboxes

 
 
=?Utf-8?B?QWxCcnVBbg==?=
Guest
Posts: n/a
 
      25th May 2007
I have a form with some textboxes and a button. I'd like for the button to
be disabled until the user enters valid data in either of two of the
textboxes, but can't quite seem to figure out how to accomplish this.
Ideally, I'd like for this to happen without having to post back to the
server, but that's not a biggie.

Any help would be greatly appreciated.

Allen
 
Reply With Quote
 
 
 
 
=?Utf-8?B?QWxCcnVBbg==?=
Guest
Posts: n/a
 
      25th May 2007
BTW, I put it in the subject line, but failed to mention in the body of the
message that I have the AJAX toolkit installed on my machine.

"AlBruAn" wrote:

> I have a form with some textboxes and a button. I'd like for the button to
> be disabled until the user enters valid data in either of two of the
> textboxes, but can't quite seem to figure out how to accomplish this.
> Ideally, I'd like for this to happen without having to post back to the
> server, but that's not a biggie.
>
> Any help would be greatly appreciated.
>
> Allen

 
Reply With Quote
 
bruce barker
Guest
Posts: n/a
 
      25th May 2007
it all depends?

what do you mean by valid?
is the button enabled when the user tabs out, or per keystroke?

get any book on javascript and read about onblur, onkeydown,
document.getElementById.

-- bruce (sqlwork.com)

AlBruAn wrote:
> BTW, I put it in the subject line, but failed to mention in the body of the
> message that I have the AJAX toolkit installed on my machine.
>
> "AlBruAn" wrote:
>
>> I have a form with some textboxes and a button. I'd like for the button to
>> be disabled until the user enters valid data in either of two of the
>> textboxes, but can't quite seem to figure out how to accomplish this.
>> Ideally, I'd like for this to happen without having to post back to the
>> server, but that's not a biggie.
>>
>> Any help would be greatly appreciated.
>>
>> Allen

 
Reply With Quote
 
=?Utf-8?B?QWxCcnVBbg==?=
Guest
Posts: n/a
 
      25th May 2007
The two textboxes I'm interested in are for Member Number and SSN. I thought
of maybe using a regex expression to determine if the SSN textbox contains a
valid SSN. As for the Member Number, I'd like to enable the pushbutton by
keystroke. When the user clicks the button, I'll post the data from one of
the two fields; if the user has entered a value for Member Number, I'll check
it against the DB and pull up the records for the member. Otherwise, I'll
display a popup box stating that the user entered an incorrect Member Number.

Hopefully, this is clear enough to understand ... I know what I want, but
sometimes I can't put it in words ... LOL.

"bruce barker" wrote:

> it all depends?
>
> what do you mean by valid?
> is the button enabled when the user tabs out, or per keystroke?
>
> get any book on javascript and read about onblur, onkeydown,
> document.getElementById.
>
> -- bruce (sqlwork.com)
>
> AlBruAn wrote:
> > BTW, I put it in the subject line, but failed to mention in the body of the
> > message that I have the AJAX toolkit installed on my machine.
> >
> > "AlBruAn" wrote:
> >
> >> I have a form with some textboxes and a button. I'd like for the button to
> >> be disabled until the user enters valid data in either of two of the
> >> textboxes, but can't quite seem to figure out how to accomplish this.
> >> Ideally, I'd like for this to happen without having to post back to the
> >> server, but that's not a biggie.
> >>
> >> Any help would be greatly appreciated.
> >>
> >> Allen

>

 
Reply With Quote
 
Michael Nemtsev
Guest
Posts: n/a
 
      25th May 2007
Hello AlBruAn,

A> The two textboxes I'm interested in are for Member Number and SSN. I
A> thought of maybe using a regex expression to determine if the SSN
A> textbox contains a valid SSN.

Yep, just use the RegExp class in JS, like var re = new RegExp

As for the Member Number, I'd like to
A> enable the pushbutton by keystroke. When the user clicks the button,
A> I'll post the data from one of the two fields; if the user has

so, as was recommended use the document.getElementById to find your control
and then set .disabled property to true
the same way you can retrieve the values

A> entered a value for Member Number, I'll check it against the DB and
A> pull up the records for the member.

there you need to use the xmlhttprequest to retrieve the data from the server


A> Otherwise, I'll display a popup
A> box stating that the user entered an incorrect Member Number.

use alert(your_Text)

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

A> "bruce barker" wrote:
A>
>> it all depends?
>>
>> what do you mean by valid?
>> is the button enabled when the user tabs out, or per keystroke?
>> get any book on javascript and read about onblur, onkeydown,
>> document.getElementById.
>>
>> -- bruce (sqlwork.com)
>>
>> AlBruAn wrote:
>>
>>> BTW, I put it in the subject line, but failed to mention in the body
>>> of the message that I have the AJAX toolkit installed on my machine.
>>>
>>> "AlBruAn" wrote:
>>>
>>>> I have a form with some textboxes and a button. I'd like for the
>>>> button to be disabled until the user enters valid data in either of
>>>> two of the textboxes, but can't quite seem to figure out how to
>>>> accomplish this. Ideally, I'd like for this to happen without
>>>> having to post back to the server, but that's not a biggie.
>>>>
>>>> Any help would be greatly appreciated.
>>>>
>>>> Allen
>>>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Show Results in TextBoxes, ONLY if All TextBoxes have Data in them =?Utf-8?B?Unlhbkg=?= Microsoft Excel Programming 3 19th Nov 2007 03:30 PM
generated textboxes in Ajax UpdatePanel =?Utf-8?B?TWlrZQ==?= Microsoft ASP .NET 0 19th Sep 2007 01:06 AM
Ajax Question - Update Panel - multiple textboxes in an html table Elmo Watson Microsoft ASP .NET 0 8th May 2007 08:57 PM
ASP.NET AJAX Enabled Website Web.config error (newbie to AJAX) Tony K Microsoft ASP .NET 2 4th May 2007 05:23 AM
Deploying ASP.NET AJAX-Enabled Web site to host without AJAX insta =?Utf-8?B?QnJpYW4gRWR3YXJkcw==?= Microsoft ASP .NET 2 21st Feb 2007 10:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:58 AM.