469,318 Members | 1,914 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,318 developers. It's quick & easy.

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 1818
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

Post your reply

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

Similar topics

reply views Thread by DotNetJunkies User | last post: by
2 posts views Thread by charliewest | last post: by
3 posts views Thread by localhost | last post: by
3 posts views Thread by vodafone | last post: by
2 posts views Thread by the friendly display name | last post: by
reply views Thread by Michael | last post: by
5 posts views Thread by Anil Gupte | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.