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
11 1923
Do that with JavaScript.[html]<input type="text" name="phone" id="ph" onkeyup="document.getElementById('ac').disabled = !!this.value.length;">
<input type="text" name="account" id="ac" onkeyup="document.getElementById('ph').disabled = !!this.value.length;">[/html]
This is a JS question and belongs in the JavaScript forum, so I will move it to that.
Ronald
very intrestng..
But sir why we are setting its value to
what does it means.
very intrestng..
But sir why we are setting its value to
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.
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="document.getElementById('ac').disabled = true;">
<input type="text" name="account" id="ac" onkeyup="document.getElementById('ph').disabled = true;">
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="document.getElementById('ac').disabled = true;">
-
<input type="text" name="account" id="ac" onkeyup="document.getElementById('ph').disabled = true;">
What are you trying to do? What is the purpose?
If you got a similar problem, tell me that.
HI,
call the javascript function for both textboxes...like, - 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.
gits 5,390
Expert Mod 4TB
HI,
call the javascript function for both textboxes...like, - 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: - 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 addEventListener() and attachEvent() for this, or set the event-handler-properties like: - node.onclick = function() { alert('something') };
and: Use code tags when posting Source Code!!!!!
kind regards
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: - 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 addEventListener() and attachEvent() for this, or set the event-handler-properties like: - node.onclick = function() { alert('something') };
and: Use code tags when posting Source Code!!!!!
kind regards
No gits, my intense is not to giving .net stuff here but i just giving logic to solve the problem of current post...
the code for javascript for this post is quite simple that's why i have not write here....
gits 5,390
Expert Mod 4TB
you posted that repeatedly here in the javascript-forum ... and since .NET stuff is NOT javascript you either should explicitly mark the code as NON-javascript-code with a comment or a note or just translate it to javascript ... there is no reason to write code in another language in a specific forum ... i wouldn't even post a java-solution in the .NET forum and say thats the logic ... translate it yourself ... that is NOT appropriate and i will delete further posts of you here with such behaviour ... remember this!
regards,
MODERATOR
Sign in to post your reply or Sign up for a free account.
Similar topics
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.
|
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...
|
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??
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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(){...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
| |