473,839 Members | 1,318 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

insert data with validation

57 New Member
Sir
I face a problem.please help me. my problem is

i have to insert phone no. or a/c id in same field. i have to use two text box. one for phone no. another for a/c id. if i enter phone no. then a/c id disable. no input accept in a/c id textbox. same as phone no., when i entry a/c id then no phone no. entry allowed. On time only one entry allow. another is disable.

Please help me.

Thanks
Mar 30 '08 #1
11 1950
hsriat
1,654 Recognized Expert Top Contributor
Do that with JavaScript.[html]<input type="text" name="phone" id="ph" onkeyup="docume nt.getElementBy Id('ac').disabl ed = !!this.value.le ngth;">
<input type="text" name="account" id="ac" onkeyup="docume nt.getElementBy Id('ph').disabl ed = !!this.value.le ngth;">[/html]
Mar 30 '08 #2
ronverdonk
4,258 Recognized Expert Specialist
This is a JS question and belongs in the JavaScript forum, so I will move it to that.

Ronald
Mar 30 '08 #3
dasrasmikant
30 New Member
very intrestng..
But sir why we are setting its value to
Expand|Select|Wrap|Line Numbers
  1. !!this.value.length;
what does it means.
Mar 30 '08 #4
hsriat
1,654 Recognized Expert Top Contributor
very intrestng..
But sir why we are setting its value to
Expand|Select|Wrap|Line Numbers
  1. !!this.value.length;
what does it means.
You mean the double NOT?
It will work without the double NOT too. Its not mandatory.

Double NOT just makes sure the result is boolean.
!!0 returns false
!!n returns true (where n is any number)
Also works on strings.
Mar 30 '08 #5
dasrasmikant
30 New Member
You mean the double NOT?
It will work without the double NOT too. Its not mandatory.

Double NOT just makes sure the result is boolean.
!!0 returns false
!!n returns true (where n is any number)
Also works on strings.
Thanks for the response.
But its not working on single not.
if the purpose of its to set a boolean value then
why its not working in like below.

<input type="text" name="phone" id="ph" onkeyup="docume nt.getElementBy Id('ac').disabl ed = true;">
<input type="text" name="account" id="ac" onkeyup="docume nt.getElementBy Id('ph').disabl ed = true;">
Mar 30 '08 #6
dasrasmikant
30 New Member
You mean the double NOT?
It will work without the double NOT too. Its not mandatory.

Double NOT just makes sure the result is boolean.
!!0 returns false
!!n returns true (where n is any number)
Also works on strings.
Thanks for the response.
But its not working on single not.
if the purpose of its to set a boolean value then
why its not working in like below.

Expand|Select|Wrap|Line Numbers
  1. <input type="text" name="phone" id="ph" onkeyup="document.getElementById('ac').disabled = true;">
  2. <input type="text" name="account" id="ac" onkeyup="document.getElementById('ph').disabled = true;">
Mar 30 '08 #7
hsriat
1,654 Recognized Expert Top Contributor
What are you trying to do? What is the purpose?

If you got a similar problem, tell me that.
Mar 30 '08 #8
malav123
217 New Member
HI,
call the javascript function for both textboxes...lik e,
Expand|Select|Wrap|Line Numbers
  1. txtDayphone.Attributes.Add("Onkeypress", "return formatPhoneNumber(this)")
and check there if one of the textbox gets keypress at the same time remaining text box gets disable to data entry...... i think by implementing this your problem will be solved...


-malav.
Mar 31 '08 #9
gits
5,390 Recognized Expert Moderator Expert
HI,
call the javascript function for both textboxes...lik e,
Expand|Select|Wrap|Line Numbers
  1. txtDayphone.Attributes.Add("Onkeypress", "return formatPhoneNumber(this)")
...
this is no javascript-code ... it seems to be some .NET stuff ... please don't mess different things here ... to set an attribute to a node the regular javascript-dom-method is:

Expand|Select|Wrap|Line Numbers
  1. node.setAttribute('attrib_name', 'attrib_value');
to attach event-handlers you have different possibilities ... write it to the node directly:

[HTML]<input type="button" onclick="alert( 'clicked me');" value="click me"/>[/HTML]
or use addEventListene r() and attachEvent() for this, or set the event-handler-properties like:

Expand|Select|Wrap|Line Numbers
  1. node.onclick = function() { alert('something') };
and: Use code tags when posting Source Code!!!!!

kind regards
Mar 31 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

2
16074
by: ImraneA | last post by:
Hi there Application : Access v2K/SQL 2K Jest : Using sproc to append records into SQL table Jest sproc : 1.Can have more than 1 record - so using ';' to separate each line from each other.
0
4495
by: ImraneA | last post by:
Hi there I had pleasure of upsizing Access v97 db to Access v2K/SQL 2K. Wish to provide some knowledge gained back to community - hopefully help others. 1.Question how do you test stored procedure from SQL Server vs MS Access point of view ?
10
11199
by: Ricardo | last post by:
How can I make a insert sql string to insert direct in a table(not a dataset) using the textbox.text propert??
5
3251
by: Chris | last post by:
Based upon some prevoius postings on what to do for adding a 'add' row to a datagrid I utilize the footer to create the 'add' row. The only issue is that I have it sharing the 'UpDate_Command' and I use an argument to difference between an 'edit' vs. and 'add. But since I have field validation on both 'footer' and 'edit' columns I can't submit my edits since the footer validation kicks in.If I take the validation off then the both work fine...
2
1588
by: Playmaker | last post by:
Hopefully someone else has come across this issue. What I have is a SQL Server 2000 back-end. I've created a simple webform which has both Gridview and DataList controls on it populated with a SqlDataSource. Okay, simple enough, that all works fine. I have also enabled inserting and editing on these controls. This is a very cool feature of 2.0 and it works quite well. Functionally I am able to do everything such as inserting and...
0
1529
by: Eustice Scrubb | last post by:
In line coding problem. Here's my code: <script language="VB" runat="server"> Dim myConnection As SqlConnection Sub Page_Load(Src As Object, e As EventArgs) ' Create a connection to the SQL Server myConnection = New SqlConnection("Data Source=SERVER;" _ & "Initial Catalog=database;User Id=user;Password=password;")
3
6345
by: Bob Alston | last post by:
I have a routine to copy data to new versions of my app via insert into sql statements. Unfortunately, due to evolution of my app, sometimes the new version has more restrictive editing than an older version that I am updating. Thus I get this message. It tells me only how many records have errors, not which errors or which records. Anyone have a nice solution to identifying the specific records involved? Maybe even the specific...
3
2677
by: Mukesh | last post by:
sir, i am developing a database, which will store the users profile both personal and professional which includes the address, telephone, gender and etc. in my main table i have created a column of xml data type. i was successful in inserting the static value inside my table.by following code:--- UPDATE docs
2
2419
by: subramanian100in | last post by:
In ISO/IEC 14882:2003 document, in the section '23.2.1.3 deque modifiers', the following is mentioned: iterator insert(iterator position, const T& x); void insert(iterator position, size_type n, const T& x); template <class InputIterator> void insert(iterator position, InputIterator first, InputIterator last);
1
2525
by: ghjk | last post by:
I'm having php page with validation. This is the code. <script language="javascript" src="../javascripts/validate.js"></script> <script type="text/javascript"> function valForm(){ if(!valid_required(document.add.FullName.value)) { add.FullName.style.background = 'Yellow'; alert("First name is required field.")
0
9855
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9697
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10587
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10295
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9426
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7018
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5682
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4487
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.