Hi, Is there away to read the values in an Input form without Posting it (on a button click) and then assign values to some other fields based on the values inputted, all on client side ?
<script>
function declareFlds1(obj) {
document.frm.txt2.value = obj.value;
}
function declareFlds2(obj) {
document.frm.txt2.value = obj;
}
</script>
<form name="frm">
onBlur event
<input type="text" name="txt1" onBlur="declareFlds1(this)">
<input type="text" name="txt2">
or button
<input type="button" value="see it" onClick="declareFlds2(document.frm.txt1.value)">
</form> ---------------------------------------
{ str = "sleep is good for you. sleep gives you the energy you need to function";
ptr = /sleep/gi;Nstr = str.replace(ptr,"coffee"alert(Nstr); }
---------------------------------------
for the best results to your questions: FAQ333-2924
Is it possible to do this with dynamic parameters for the function. Since my fields are dynamically generated, like
<%
for i = 1 to 12
for j = 1 to 12 %>
<TD width=35><font face='Arial,Helvetica' size='2'>
<input type=text name=expense_<%=i%>_<%=j%>>
</font></TD>
<%next %>
</TR><TR>
<%next %>
and I do not know how many fields are there or what their names are ??
Step 2. Use the tags() function to get a collection of all the input fields on the form.
var bigColletion = document.all.tags("INPUT"
Step 3. Use the className property to filter the list down to just the fields you are interested in.
for(i=0; i<bigColletion.length; i++)
{
if(bigCollection.item.className == "findTheseOnes"
{
//What is the number
tmp = parseInt(bigCollection.item(i).id);
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.