473,405 Members | 2,373 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,405 software developers and data experts.

Substring a value for display and concatenate for validation?

Hello,

I have a validation script for upc codes which is currently working for
values that are entered into one text box. I've been asked to break up
the text box into 3 separate fields to accept the 1st digit, middle 10
digits, then last check digit. What I'm doing is substringing the
initial values then concatenating them. What I'm not sure of is, how to
handle the validation. I was previously firing an onBlur after the text
box but now that I have three, and I need the values to concatenate
into one for the validation. Should I just fire a function after the
3rd field that concatenates the 3 values, then pass that value to the
validation function? Or is there a better way?

I was also wondering if there was something I could find like an input
mask, but something that could just "overlay" on top of a regular text
box with one value which could give the appearance of having
separations for certain digits, in this case the first and last. Hope
this all makes sense and someone can help. I would sure appreciate any
help at all.

Thanks,
KP

Feb 28 '06 #1
1 1693

Kermit Piper wrote:
Hello,

I have a validation script for upc codes which is currently working for
values that are entered into one text box. I've been asked to break up
the text box into 3 separate fields to accept the 1st digit, middle 10
digits, then last check digit. What I'm doing is substringing the
initial values then concatenating them. What I'm not sure of is, how to
handle the validation. I was previously firing an onBlur after the text
box but now that I have three, and I need the values to concatenate
into one for the validation. Should I just fire a function after the
3rd field that concatenates the 3 values, then pass that value to the
validation function? Or is there a better way?


Validating on blur is seen as rather hostile and un-professional, but
if you must,
just call the function with the onblur event of all the involved
fields, then have the
function abort if any field is blank.

--
S.C.

Feb 28 '06 #2

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

Similar topics

2
by: Mark | last post by:
I am trying to populate a field in a SQL table based on the values returned from using substring on a text field. Example: Field Name = RecNum Field Value = 024071023 The 7th and 8th...
2
by: ja | last post by:
Hello, I am trying to combine/substring parts of three different fields into one. For example, in sql, the syntax is as follows: Once the extra field has been added to the table, update...
5
by: siaj | last post by:
Hello, I have a javascript function for a validation in the HTML page of the asp.Net page.. I call this function in a Savebutton click When the validation fails No postback should happen ( ie...
2
by: Oleg Ogurok | last post by:
Hi there, I have a modified ASP.NET TextBox control that formats its output as the phone number, e.g. if you enter "1234567890" it'll change the value to "123-456-7890". This is done by a...
5
by: =?Utf-8?B?bWNhdWxpZmZl?= | last post by:
I have an old application ( pre-VB5) that I need to add a select/option list to. This is an edit program so the values for the form will be retrieved from a database. How do I set the value of...
5
by: littlevikinggirl | last post by:
Hi, I posted a badly worded question last week so got no replies and am still struggling to figure out the problem myself. I have a table containing two fields, Location and Serial Number. I...
11
by: dyc | last post by:
how do i make use of substring method in order to extract the specified data from a a long string? I also need to do some checking b4 extracting the data, for instance: it only will extract the...
2
by: Steve Richter | last post by:
getting this "potentially dangerous Request.Form value was detected" exception with a textbox which I have populated with some source code. I think I am getting the exception when I click OK on...
1
by: sjharri | last post by:
I have an application providing me with multiple headers which I have mergerd into one big header (below), this header my not always be the same but I need to be able to extract a periodstart and...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.