473,581 Members | 2,875 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamic creation go textbox

2 New Member
I've created a texbox dynamically when a value is selected in a listbox. But that text box is just created and vanishes on page submission.

Plese let me know how to go with this.

here is the code snippet


Expand|Select|Wrap|Line Numbers
  1. if(document.addCR.softwareName.value == 'Others'){
  2.             document.addCR.hdnSelectedSW.value = document.addCR.softwareName.value; 
  3.             var mytablebody = document.getElementById('otherName');
  4.             var row=document.createElement("<TR>");
  5.             var srch = document.createElement("<TD>");
  6.             var txt1 = document.createTextNode("Other Name");
  7.             srch.appendChild(txt1);
  8.             row.appendChild(srch);
  9.  
  10.              var td3=document.createElement("TD");
  11.              var otherTxt = td3.appendChild(document.createElement("<input type='text' name='otherText'></input>"));
  12.              row.appendChild(td3);
  13.              mytablebody.appendChild(row);
  14.              otherName.style.visibility = 'visible';
  15.         }else{
  16.  
  17.                 otherName.style.visibility = 'hidden';
  18.              }
This is in a function and that function is called onChange() of the <select>
Aug 16 '07 #1
3 1887
acoder
16,027 Recognized Expert Moderator MVP
Welcome to TSDN!

What do you expect it do? Post the rest of your code too.

Please post code using CODE tags. Thanks!
Aug 16 '07 #2
gvmadhusudhan
2 New Member
Welcome to TSDN!

What do you expect it do? Post the rest of your code too.

Please post code using CODE tags. Thanks!

Thanks !! Got the solution
Aug 17 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
Thanks !! Got the solution
Glad you got it working. If you could post a working solution, it might help someone with a similar problem.
Aug 17 '07 #4

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

Similar topics

0
1658
by: DotNetJunkies User | last post by:
Hie, I create a dynamique HtmlTable, in each cell of this HtmlTable put a new control ( dropdownlist,label,..) and then want to create handler so that if i change the select item in the dop downlist i change the text displayed in the label in the same row. hier is my code: using System; using System.Collections; using System.ComponentModel;...
7
3508
by: Bil Muh | last post by:
Esteemede Developers, I would like to Thank All of You in advance for your sincere guidances. I am developing a software using Visual C++ .NET Standard Edition with Windows Form (.NET) template. Briefly -------------------------------------------------------------------------------------------- I need to create dynamically some...
2
16238
by: charliewest | last post by:
I need to create textboxes in real-time, the actual number of which is determine by a result from a database query. I have been able to create the controls, and then add them to the ASPX page. However, when i submit the page, i am unable to read the values entered in these new textboxes. I have first tried to use ...
3
2172
by: localhost | last post by:
In my ASP.NET page code-behind, I have added a textbox like this: (C#) System.Web.UI.HtmlControls.HtmlGenericControl div1= new HtmlGenericControl( "div" ); div1.ID = "divNewTextBox"; TextBox txt1 = new TextBox(); div1.Controls.Add( txt1 );
3
3639
by: PABruceFan | last post by:
I am dynamically adding rows to an asp:table as a result of a database query. The row consists of a label, a textbox and three checkboxes in that order: LABEL TEXTBOX CHECKBOX1 CHECKBOX3 CHECKBOX2 name1 email1 checked checked checked name2 email2 not checked checked checked I have no problem adding the...
3
1705
by: vodafone | last post by:
Hy all I've a little problem. I need to write a dynamic page that render control according to validation status return from previous control validation status. To be clear, I've page that starts requesting some info, then user press a button, and the same page should show the new field only if validation returns true. But it sounds not...
2
1536
by: the friendly display name | last post by:
Hello newsgroup.. Following problem: I have two buttons on a page, If I click on button1, an additional textbox should be dynamical created and added to a panel. If I click on button2, one box should be removed from the Panel. The values of the textboxes should of course be the same through all viewstates.
0
2434
by: Michael | last post by:
Hi All, I have a general question. I'm in the process of designing a app that will allow user to enter data for Medical forms and print the corresponding word doc. I have about 100 forms I have to do this for. And I'm looking for ideas that will help with my design. I'm trying to make this code as general as possible, so that as they...
5
4988
by: Anil Gupte | last post by:
How does one access dynamic controls by name (or whatever other means)? I have the following: Dim newbtnPick As New Button newbtnPick.Name = "SliceButton" & CurSliceNum newbtnPick.Location = New Point(SILoc.SIPickbtn, SILoc.SIY3) newbtnPick.Size = New Size(SILoc.btnW, SILoc.btnH) newbtnPick.Text = "Pick->" Sender.Controls.Add(newbtnPick)...
1
4885
by: cdmsenthil | last post by:
I have an Infragistics UltrawebGrid . Each Row in the grid is attached to a context menu using Infragistics CSOM Upon click on the menu, I am creating an Iframe dynamically which points to another page in the same domain which also contains infragistics datagid populated with default data retrieved from Data Base. After creating the frame I...
0
7808
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...
0
8157
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7914
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5683
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5366
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...
0
3809
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...
0
3835
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2309
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
0
1145
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.