...

View Full Version : How do I access the data in the textboxes in to collection object



tech99sri
05-02-2008, 05:47 PM
How do I access the data in the textbox in to a collection object.
The collection object is in the bean.
Please provide a solution


Here is my code for creating the textbox and check box when a button is pressed.


<form name="frm" id="frm" action="../wait.html" method="post" >
<div id="set1" style="position:absolute; left:65px;top:146px;" style = "hidden">
<span id="output"></span>
<input type="button" value="Add" onclick="Add()">
<script type="text/javascript">
function Add()
{
var checkbox=document.createElement('input');
var inps=document.createElement('input');
var label=document.createElement('label');
var output=document.getElementById('output');
checkbox.type='checkbox';
label.innerHTML='Firstname';
label.style.paddingRight='10px';
inps.type='text';
inps.name='textboxname';
checkbox.name='checkname';
output.appendChild(checkbox);
output.appendChild(label);
output.appendChild(inps);
output.appendChild(document.createElement('br'));
}
</script>
</div>
</form>

abduraooft
05-02-2008, 05:50 PM
http://www.w3schools.com/HTMLDOM/prop_text_value.asp

Kor
05-02-2008, 08:34 PM
The attribute which controls the text within a textbox is value
===
Note: IE has a bug. It does not set properly the attribute "name" in DOM. You must use a workaround


//...
var isIE=/*@cc_on!@*/false;//IE detector
var checkbox, inps;
if(isIE){
checkbox=document.createElement('<input name="textboxname">');
inps=document.createElement('<input name="checkname">');
}
else{
checkbox=document.createElement('input');
checkbox.name='checkname';
inps=document.createElement('input');
inps.name='textboxname';
}
//...the rest of the code



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum