Hi,
Trying to better phrase my question, so here goes.
I have 3 functions. I do not know how to have 2 functions recognize the output of an array from the other function. All of this revolves around input(text boxes). What is the array's output? In other words, how do I get the newly added textboxes recognized by the initial functions - what are they called? I have tried adding names like "No. of Hours[1]"; "No. of Hours(1)"; or,"No. of Hours1"; but none of that works.
For example, one of the inputs is called "No. of Hours". That is the input textbox on the web page. When the add new rows array is invoked it adds new input textboxes and the new element is
Code:
el.type = 'text';
el.name = 'No. of Hours' + iteration;
el.id = 'No. of Hours' + iteration;
el.size = 7;
cellRight.appendChild(el);What is this new input/element called so that I can refer to it for the coded function shown below?
The first function provides validation for user input.
Code:
function checkQuarters( fld )
{
var val = parseFloat(fld.value);
if ( isNaN(val) || ( val*4 != Math.floor(val*4) ) )
{
alert("Value must be a numeric and a multiple of 0.25");
return false;
}
return true;
}
</script>
The input for the above function is
Code:
<td>
<form style="width: 5px; height: 1px;">
<input type="text" name="No. of Hours" id="No. of Hours" style="width: 70px;" onblur="checkQuarters(this);" />
</form></td>The array outputs added textboxes thusly,
Code:
new_rows[row_count]['cell3']=sel;
var cellRight = row.insertCell(3);
var el = document.createElement('input');
el.type = 'text';
el.name = 'No. of Hours' + iteration;
el.id = 'No. of Hours' + iteration;
el.size = 7;
cellRight.appendChild(el);
new_rows[row_count]['cell']=el;
row_count++;The other function uses a JQuery for a datepicker.
Code:
<script type="text/javascript">
$(function() {
$("#startdate").datepicker();
$("#enddate").datepicker();
}); </script>The input is this.
Code:
<td><input style="width: 70px" type="text" id="startdate"></td>
<td><input style="width: 70px" type="text" id="enddate"></td>I am lost on this and could really use some help and guidance.
Thanks,
John
Trying to better phrase my question, so here goes.
I have 3 functions. I do not know how to have 2 functions recognize the output of an array from the other function. All of this revolves around input(text boxes). What is the array's output? In other words, how do I get the newly added textboxes recognized by the initial functions - what are they called? I have tried adding names like "No. of Hours[1]"; "No. of Hours(1)"; or,"No. of Hours1"; but none of that works.
For example, one of the inputs is called "No. of Hours". That is the input textbox on the web page. When the add new rows array is invoked it adds new input textboxes and the new element is
Code:
el.type = 'text';
el.name = 'No. of Hours' + iteration;
el.id = 'No. of Hours' + iteration;
el.size = 7;
cellRight.appendChild(el);What is this new input/element called so that I can refer to it for the coded function shown below?
The first function provides validation for user input.
Code:
function checkQuarters( fld )
{
var val = parseFloat(fld.value);
if ( isNaN(val) || ( val*4 != Math.floor(val*4) ) )
{
alert("Value must be a numeric and a multiple of 0.25");
return false;
}
return true;
}
</script>
The input for the above function is
Code:
<td>
<form style="width: 5px; height: 1px;">
<input type="text" name="No. of Hours" id="No. of Hours" style="width: 70px;" onblur="checkQuarters(this);" />
</form></td>The array outputs added textboxes thusly,
Code:
new_rows[row_count]['cell3']=sel;
var cellRight = row.insertCell(3);
var el = document.createElement('input');
el.type = 'text';
el.name = 'No. of Hours' + iteration;
el.id = 'No. of Hours' + iteration;
el.size = 7;
cellRight.appendChild(el);
new_rows[row_count]['cell']=el;
row_count++;The other function uses a JQuery for a datepicker.
Code:
<script type="text/javascript">
$(function() {
$("#startdate").datepicker();
$("#enddate").datepicker();
}); </script>The input is this.
Code:
<td><input style="width: 70px" type="text" id="startdate"></td>
<td><input style="width: 70px" type="text" id="enddate"></td>I am lost on this and could really use some help and guidance.
Thanks,
John