473,396 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

AJAX and textboxes

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
May 25 '07 #1
4 1151
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
May 25 '07 #2
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
May 25 '07 #3
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
May 25 '07 #4
Hello AlBruAn,

AThe two textboxes I'm interested in are for Member Number and SSN. I
Athought of maybe using a regex expression to determine if the SSN
Atextbox 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
Aenable the pushbutton by keystroke. When the user clicks the button,
AI'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

Aentered a value for Member Number, I'll check it against the DB and
Apull up the records for the member.

there you need to use the xmlhttprequest to retrieve the data from the server
AOtherwise, I'll display a popup
Abox 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

May 25 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Elmo Watson | last post by:
I've got quite a few textboxes on my page, along with labels, within a table. In these textboxes, I use the onTextChanged event (with autopostback=true) to calculate some formulas, and put the...
8
by: BillE | last post by:
I have an existing asp.net 2.0 webforms app using master/content pages, and it works fine. I added some Ajax elements, including some UpdatePanels and modal PopUp panels which contain asp.net...
2
by: =?Utf-8?B?VG9u?= | last post by:
Hello, I want to understand teh benefits of ajax technology. Does anyone has a good website where AJAX EXTENSIONS is worked out so I really understand it. There a 2 main questions: 1) How about...
0
by: Med | last post by:
Hi, I have two dropDown lists ddlCars and ddlModels. ddlCars AutoPostBack="true" to populate the ddlModels when a car is selected. If the page is not valid (i.e. user left a mandatory textbox...
1
by: sasimca007 | last post by:
Hi friends, I have a screen with three selection textboxes (select boxes) and a listgrid. I have a add button to add the details entered in textboxes into listgrid. when one row...
3
sunbin
by: sunbin | last post by:
Hi, I am having in a Trouble when working with dynamic checkboxes (i.e. checkboxes with the same name, e.g. <input type="checkbox" name = "check" value="dynamic integer value">) I have...
3
by: jarremw | last post by:
hello all, what i have is a modal popup control extender, i have an ajax script that saves the value of the two textboxes that are in the popup, what i am needing is a way to insert those values into...
2
by: Luqman | last post by:
I have a Ajax Tab Container on my Webform with One Panel and some Labels and Textboxes. I want to Iterate through all the textboxes and return their IDs. I tried every possibility I could but...
4
by: Peter | last post by:
ASP.NET I have an application which use ASP.NET Autocomplete extender which works great. But I have a question how to update all the fields on the screen using Ajax. Users starts typing in a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.