0

hi, i want to have a button wherein it will create dynamic text boxes depending on the times i click the button. i've seen several codes thru javascript, however, i cannot get the value of the said textbox,

could you please help me with this?? tnx..^^

5
Contributors
7
Replies
11
Views
7 Years
Discussion Span
Last Post by network18
0

U can simply get the value of the checkbox if u use jquery.

if The text box is <input type="text" name="example" id="example">

Then u can take the value of that text box in js page by this simple code.

var textname = $("input#example").val();

enjoy coding.

0

hi, i want to have a button wherein it will create dynamic text boxes depending on the times i click the button. i've seen several codes thru javascript, however, i cannot get the value of the said textbox,

could you please help me with this?? tnx..^^

hi,xuexue
where is your code?

0

i always use this function to get any value
<input type="text" name="example" id="example" value="">

<script type="javascript">
function getValue()
{
   var txtValue = document.getElementById("example").value;
   return
}
</script>

this button display your value after clicked
<input type="button" onClick="getValue()">

hopefully you're clear

0

yeah it is the solution for you problem. thanks for sharing this with us.

0

hi, i want to have a button wherein it will create dynamic text boxes depending on the times i click the button. i've seen several codes thru javascript, however, i cannot get the value of the said textbox,

could you please help me with this?? tnx..^^

I thinking you looking to create the textboxes onclick of some button,
something like below can help you to get started -

<input type='button' value='Add new ' onclick='AddRow()'>
function AddRow() {
    var table = document.getElementById( 'insertorder' );
    var tbody = table.getElementsByTagName( 'TBODY' )[ 0 ];
    var numRows = tbody.rows.length;
	if(numRows >12)return false;
    var where   = tbody.rows[ numRows - 1 ];
    var newRow  = emptyRow.cloneNode( true );
	for(var i=0; i<tbody.rows.length; i++)
	{
		var new_name = "l2pn";
		for(var j=0; j<tbody.rows[i].childNodes.length; j++)
		{
			alert(">>"+tbody.rows[i].childNodes[j].getAttribute("Name")+">>");
			//tbody.rows[i].childNodes[j].setAttribute('name',new_name);
    	}	

    }
	insertAfter( where, newRow, numRows );
  }
0

well, guys, thanks for your help.
hmm, could you give me the whole code itself?
i mean from the moment you create the dynamic text box up to the value getting of the created text box?

thanks a lot..^^

0

well, guys, thanks for your help.
hmm, could you give me the whole code itself?
i mean from the moment you create the dynamic text box up to the value getting of the created text box?

thanks a lot..^^

try to change the code on your own ,according to your need; post the errors here, if you stuck up somewhere

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.