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

declaring text box

8
how to declare a textbox in Javascript???
Oct 27 '08 #1
12 1915
acoder
16,027 Expert Mod 8TB
Can you be more clear in defining your problem/question? What do you mean by declaring a text box? Do you mean creating one and displaying it?
Oct 27 '08 #2
Aseef
8
Thank you for ur response. The requirement is like this. i have a java script function 'displayTxtBox()'. i just want pass the text boxes names while calling this function. can you helpme? how can ido that?
Oct 27 '08 #3
gits
5,390 Expert Mod 4TB
i don't understand this ... are the textboxes just hidden or do you need to create them dynamically first? ... the function should just receive the name of the box - what should exactly happen then? please show what you have done so far and give an example for the wished behaviour ...

kind regards
Oct 27 '08 #4
Aseef
8
the text boxes will be hidden at the page load. in the fuction i have wriiten the code to make it visible. please see the below mail

Expand|Select|Wrap|Line Numbers
  1. function displayCalibTxt()
  2.  {
  3.    document.Form1.TxtCalib1.style.display='block'
  4.    document.Form1.TxtCalib2.style.display='block'
  5. }
so instead of writing the text boxes id one by one. can i pass the text box id as parameter?
Oct 27 '08 #5
Aseef
8
please let me know if you want it more clear
Oct 27 '08 #6
acoder
16,027 Expert Mod 8TB
so instead of writing the text boxes id one by one. can i pass the text box id as parameter?
Yes, of course.
Expand|Select|Wrap|Line Numbers
  1. function displayTxtBox(id) {
  2.     document.getElementById(id).style.display='block';
  3. }
Remember to make sure the ID is unique.
Oct 27 '08 #7
Aseef
8
Thank you very much for the prompt help
Oct 27 '08 #8
acoder
16,027 Expert Mod 8TB
No problem. Post again if you have more questions :)
Oct 27 '08 #9
Aseef
8
Am sorry to bother u guys. i tried to make the function as above. an d i called the function like
<TD onclick="displayText(TxtID)"><INPUT id="TxtID" style="WIDTH: 39px; HEIGHT: 22px" type="text" size="1" name="Txt1></TD>

but i am getting error. can you pls help me.
Nov 2 '08 #10
Aseef
8
can anyone help me please. please let me know if it wanted to be more clear.
Nov 2 '08 #11
Aseef
8
Yes. I got it. i misssed quotes while passing the parameter.
Nov 2 '08 #12
acoder
16,027 Expert Mod 8TB
Yes, that's correct. Well done- you managed to solve it yourself.
Nov 2 '08 #13

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

Similar topics

2
by: Oliver Corona | last post by:
I am wondering if anyone has any insights on the performance benefit (or detriment) of declaring local variables instead of referencing members. Is allocating memory for a new variable more...
5
by: fred | last post by:
I don't know if I'm doing this correctly. I have a little programming experience in python, c++ and some others but this is my first time with javascript. I'm trying have my website detect the...
11
by: arekkusu | last post by:
Hello, I have the following problem: when declaring hex data in C, you typically do something like: const char = {0xde, 0xad, 0xbe, 0xef, 0x01, 0x02, 0x03, 0x04 ... }; This is quite verbose...
1
by: Maarten Terlingen | last post by:
Sample: ClassA: ClassB ClassB: ClassC ClassA x = new Class C I want to know the declaring type of C. x.GetType() returns C x.GetType().BaseType returns B x.GetType().BaseType.BaseType...
18
by: Nathan | last post by:
If you're wondering why I post so many questions, it's because I want to make an entry in the Guinness Book of World Records. But because I post so many, I try to make them simple. Here is (I...
1
by: John Dann | last post by:
Is there a way of declaring an array of a structure where the structure has a constructor? So if I had a structure say Friend MyStructure prop1 as integer prop2 as string sub New (p1 as...
1
by: photo | last post by:
Hi! I am new to .net (vb) and moving from classic asp. I ran into a problem that has left me with less hair on my head. For some reason, my button and calendar that sits inside an...
2
by: majel | last post by:
I just read an older post that described declaring global variables. I tried this but I'm getting an error and the text stays red. What am I doing wrong? This code is behind a form. Thanks. ...
5
by: Rahul B | last post by:
Hi, I have very little knowledge about creating Procedures/functions in DB2. When i tried to create the test function like CREATE FUNCTION GET_TEST (P_TEST_ID INTEGER, P_SEL_OR_SORT...
4
by: Peter Duniho | last post by:
On Thu, 14 Aug 2008 18:56:00 -0700, Phill <Phill@discussions.microsoft.comwrote: For future reference, if you are asking for help with an error (compile or execution), you really should post...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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
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.