473,385 Members | 1,766 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,385 software developers and data experts.

Dynamic creation go textbox

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 1871
acoder
16,027 Expert Mod 8TB
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
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 Expert Mod 8TB
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
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...
7
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)...
2
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....
3
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";...
3
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 ...
3
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...
2
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...
0
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...
5
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 =...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
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...
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
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...

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.