Regular expressions and an adding function... WHOPPING 500 points... who wants it?!?

All,

This problem is really annoying me.

I have a HTML page (well, I have a couple of them) and on these pages there are a number of Input textboxes.  There is a couple of things I need/want them to do.

1.  When the page loads up, I need them to populate with information from a function that I have already set up.

2.  Also, when the page loads, I need to then add up all the values in these textboxes so that I get a total.

3.  If a user enters a textbox and then leaves, I need to make the textbox display the original value (which could either come from the original function in 1 above, or be '0')

4.  The names of these textboxes are set at 'newValueX', where X is a number dependant on the page and the textbox in question.

I have copied the part of the code that I am having a problem with below:

<FORM name="aForm">
<TABLE cellpadding="1" cellspacing="4" width="100%">
<TBODY>
<TR bgcolor="#cccccc">
<TD align="left" colspan="5">NAME</TD>

<TD align="left">STUFF</TD>

</TR>

<TR bgcolor="#cccccc">
<TD align="left" width="13%>AAA<TD>
<TD align="left" width="13%">BBB</TD>
<TD align="left" width="13%">CCC</TD>
<TD align="left" width="20%">DDD</TD>
<TD align="left" width="20%">EEE</TD>
<TD align="left" width="20%">FFF</TD>
</TR>

<TR bgcolor="#eeeeee">
<TD colspan="5" align="left">NAME2</TD>
<TD colspan="1" align="left"><IMG src="../image/roundbutton.gif" width="18" height="18" border="0"> <A href="#" accesskey="v">View (V)</A></TD>
</TR>

<TR bgcolor="#eeeeee">
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%<INPUT type="text" size="8" maxlength="8" value=0 name="newValue2" onfocus="value=''" onblur='if (value=="") value="0"; javascript:addLumpSumValues();'></SPAN></TD>
</TR>


<TR bgcolor="#eeeeee">
<TD colspan="5" align="left">NAME3</TD>
<TD colspan="1" align="left"><IMG src="../image/roundbutton.gif" width="18" height="18" border="0"> <A href="#" accesskey="v">View (V)</A></TD>
</TR>

<TR bgcolor="#eeeeee">
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%<INPUT type="text" size="8" maxlength="8" value=0 name="newValue3" onfocus="value=''" onblur='if (value=="") value="0"; javascript:addLumpSumValues();'></SPAN></TD>
</TR>

<TR bgcolor="#eeeeee">
<TD colspan="5" align="left">NAME4</TD>
<TD colspan="1" align="left"><IMG src="../image/roundbutton.gif" width="18" height="18" border="0"> <A href="#" accesskey="v">View (V)</A></TD>
</TR>

<TR bgcolor="#eeeeee">
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%<INPUT type="text" size="8" maxlength="8" value=0 name="newValue4" onfocus="value=''" onblur='if (value=="") value="0"; javascript:addLumpSumValues();'></SPAN></TD>
</TR>

<TR>                                                
<TD align="right">
<TABLE>
<TBODY>
<TR>
<TD align="right">GBP</TD>
<TD align="right"><INPUT type="text"      size="8" maxlength="8" name="total" readonly value="0"></TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
</FORM>


AND THE ADDING FUNCTION:

function addLumpSumValues()
{
var search = new RegExp("/ \bnewValue\b /");
var count=document.getElementsByName(search);
var countloop = count.length;
var totalval = 0;

for (i=2;i<countloop;i++)
{
   searchTEXT = "newValue" + i
   if(document.aForm.elements[i].name == searchTEXT)
   {
     theVal=document.aForm.elements[i].value;
     var Y = parseInt(theVal);
     totalval = totalval + Y;
     totalval.toPrecision(2;
   }
   else
   {
   countloop = countloop + 1
   }
   document.aForm.total.value = totalval
}
}


**********************************************

500 points (or a share of them), to anyone who can help out on this one...
squish2307Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jaysolomonCommented:
This line

     totalval.toPrecision(2;

Should be this

     totalval.toPrecision(2); // You forgot the  ending )

and this

<TD align="left" width="13%>AAA<TD>

Should be this
<TD align="left" width="13%">AAA</TD>



0
James RodgersWeb Applications DeveloperCommented:
to poulate the textboxes on load you will need to use the onload event of the document

<body onload="populateFunction(); addLumpSumValues()">

need this expalined more

If a user enters a textbox and then leaves, I need to make the textbox display the original value (which could either come from the original function in 1 above, or be '0')
if you need to keep the values as set by your onload populate function you could make the textboxes readonly
<input type="text" name="newValueX" value="" readonly>
and/or once the user leaves teh textbox use the onBlur event to rerun the populate function

<input type="text" name="newValueX" value="" readonly onBlur="populateFunction()">

I need you to clarify the requirements for 3 + 4
0
jaysolomonCommented:
Agree with jester clarification
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

squish2307Author Commented:
JaySolomon... they were both typos.  Sorry.

Jester_48,

I was considering a 'populateFunction' at the beginning.  But it would need a couple of parameters to be sent to the function.  Which shouldn't be a problem, until the numbering goes out of kilter (which IS a problem).

with regards to your suggestion of 'readonly', this is NOT viable.  The idea is for a user to enter a number into the textboxes and this is then totaled.  So when they enter the text box it clears the contents and the user enters a new number.  BUT, if they leave it empty, it should refill with the original number.  I won't be able to use the populateFunction as mentioned in the previous paragraph as the user would loose all numbers entered up to that point (with me?) and thus have to start again.

Requirement 3 is answered above.

Requirement 4, this relates to the naming convention of the textboxes, eg "name = newValue3".  I have 4 similar pages, but the textboxes are numbered relating to the information that they will contain.  Hence the numbers will be different on page 2, 3 etc.

I hope this helps.

Thanks guys...

0
NetGrooveCommented:
Here afirst approach:

<html>
<head>
<script>
function addLumpSumValues(theField) {
 if(isNaN(theField.value)){
   theField.value = "0";
 }
 theField.value*=1;
 var totalval = 0;
 for (i=2;i<5;i++){
   theVal=document.aForm["newValue" + i].value;
   var Y = parseInt(theVal);
   totalval = totalval + Y;
   totalval.toPrecision(2);
 }
 document.aForm.total.value = totalval
}

</script>
</head>
<body>
<FORM name="aForm">
<TABLE cellpadding="1" cellspacing="4" width="100%">
<TBODY>
<TR bgcolor="#cccccc">
<TD align="left" colspan="5">NAME</TD>

<TD align="left">STUFF</TD>

</TR>

<TR bgcolor="#cccccc">
<TD align="left" width="13%>AAA<TD>
<TD align="left" width="13%">BBB</TD>
<TD align="left" width="13%">CCC</TD>
<TD align="left" width="20%">DDD</TD>
<TD align="left" width="20%">EEE</TD>
<TD align="left" width="20%">FFF</TD>
</TR>

<TR bgcolor="#eeeeee">
<TD colspan="5" align="left">NAME2</TD>
<TD colspan="1" align="left"><IMG src="../image/roundbutton.gif" width="18" height="18" border="0"> <A href="#" accesskey="v">View (V)</A></TD>
</TR>

<TR bgcolor="#eeeeee">
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%"><INPUT type="text" size="8" maxlength="8" value=0 name="newValue2" onfocus="this.value=''" onblur='addLumpSumValues(this);'></SPAN></TD>
</TR>


<TR bgcolor="#eeeeee">
<TD colspan="5" align="left">NAME3</TD>
<TD colspan="1" align="left"><IMG src="../image/roundbutton.gif" width="18" height="18" border="0"> <A href="#" accesskey="v">View (V)</A></TD>
</TR>

<TR bgcolor="#eeeeee">
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%"><INPUT type="text" size="8" maxlength="8" value=0 name="newValue3" onfocus="this.value=''" onblur='addLumpSumValues(this);'></SPAN></TD>
</TR>

<TR bgcolor="#eeeeee">
<TD colspan="5" align="left">NAME4</TD>
<TD colspan="1" align="left"><IMG src="../image/roundbutton.gif" width="18" height="18" border="0"> <A href="#" accesskey="v">View (V)</A></TD>
</TR>

<TR bgcolor="#eeeeee">
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%"><INPUT type="text" size="8" maxlength="8" value="0" name="newValue4" onfocus="this.value=''" onblur='addLumpSumValues(this);'></SPAN></TD>
</TR>

<TR>                                        
<TD align="right">
<TABLE>
<TBODY>
<TR>
<TD align="right">GBP</TD>
<TD align="right"><INPUT type="text"     size="8" maxlength="8" name="total" readonly value="0"></TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
</FORM>

</body>
</html>



0
NetGrooveCommented:
And here the second approach:


<html>
<head>
<script>
function addLumpSumValues(theField) {
 if(isNaN(theField.value)){
   theField.value = "0";
 }
 theField.value*=1;
 var totalval = 0;
 for (i=2;i<5;i++){
   theVal=document.aForm["newValue" + i].value;
   var Y = parseInt(theVal);
   totalval = totalval + Y;
   totalval.toPrecision(2);
 }
 document.aForm.total.value = totalval
}

</script>
</head>
<body>
<FORM name="aForm">
<TABLE cellpadding="1" cellspacing="4" width="100%">
<TBODY>
<TR bgcolor="#cccccc">
<TD align="left" colspan="5">NAME</TD>

<TD align="left">STUFF</TD>

</TR>

<TR bgcolor="#cccccc">
<TD align="left" width="13%>AAA<TD>
<TD align="left" width="13%">BBB</TD>
<TD align="left" width="13%">CCC</TD>
<TD align="left" width="20%">DDD</TD>
<TD align="left" width="20%">EEE</TD>
<TD align="left" width="20%">FFF</TD>
</TR>

<TR bgcolor="#eeeeee">
<TD colspan="5" align="left">NAME2</TD>
<TD colspan="1" align="left"><IMG src="../image/roundbutton.gif" width="18" height="18" border="0"> <A href="#" accesskey="v">View (V)</A></TD>
</TR>

<TR bgcolor="#eeeeee">
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%"><INPUT type="text" size="8" maxlength="8" value=0 name="newValue2" onfocus="this.oldValue=this.value;this.value=''" onblur='if(this.value=="")this.value=this.oldValue;addLumpSumValues(this);'></SPAN></TD>
</TR>


<TR bgcolor="#eeeeee">
<TD colspan="5" align="left">NAME3</TD>
<TD colspan="1" align="left"><IMG src="../image/roundbutton.gif" width="18" height="18" border="0"> <A href="#" accesskey="v">View (V)</A></TD>
</TR>

<TR bgcolor="#eeeeee">
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%"><INPUT type="text" size="8" maxlength="8" value=0 name="newValue3" onfocus="this.oldValue=this.value;this.value=''" onblur='if(this.value=="")this.value=this.oldValue;addLumpSumValues(this);'></SPAN></TD>
</TR>

<TR bgcolor="#eeeeee">
<TD colspan="5" align="left">NAME4</TD>
<TD colspan="1" align="left"><IMG src="../image/roundbutton.gif" width="18" height="18" border="0"> <A href="#" accesskey="v">View (V)</A></TD>
</TR>

<TR bgcolor="#eeeeee">
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%"><INPUT type="text" size="8" maxlength="8" value="0" name="newValue4" onfocus="this.oldValue=this.value;this.value=''" onblur='if(this.value=="")this.value=this.oldValue;addLumpSumValues(this);'></SPAN></TD>
</TR>

<TR>                                        
<TD align="right">
<TABLE>
<TBODY>
<TR>
<TD align="right">GBP</TD>
<TD align="right"><INPUT type="text"     size="8" maxlength="8" name="total" readonly value="0"></TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
</FORM>

</body>
</html>




0
James RodgersWeb Applications DeveloperCommented:
these seem contradictory

>>When the page loads up, I need them to populate with information from a function that I have already set up

>>I was considering a 'populateFunction' at the beginning.  But it would need a couple of parameters to be sent to the function.  Which shouldn't be a problem, until the numbering goes out of kilter (which IS a problem).

what numbering?
 you could try this to add up your newValue text boxes

function addLumpSumValues(){
var search = new RegExp("/ \bnewValue\b /");
var count=document.getElementsByName(search);
var totalval = 0;
for (i=0;i<count;j++) {
       if (document.aForm.elements['newValue'+i].value!='')
         totalval += document.aForm.elements['newValue'+i].value;
     }
      
      
}
document.aForm.total.value = totalval
}


populateFunction(objTxt){

}
0
NetGrooveCommented:
And here some parametrazation:

<html>
<head>
<script>
var fieldPrefix = "newValue";
var firstFieldNum = 2;
var lastFieldNum = 4;
function addLumpSumValues(theField) {
 if(isNaN(theField.value)){
   theField.value = "0";
 }
 theField.value*=1;
 var totalval = 0;
 for (i=firstFieldNum;i<=lastFieldNum;i++){
   theVal=document.aForm[fieldPrefix + i].value;
   var Y = parseInt(theVal);
   totalval = totalval + Y;
   totalval.toPrecision(2);
 }
 document.aForm.total.value = totalval
}

</script>
</head>
<body>
<FORM name="aForm">
<TABLE cellpadding="1" cellspacing="4" width="100%">
<TBODY>
<TR bgcolor="#cccccc">
<TD align="left" colspan="5">NAME</TD>

<TD align="left">STUFF</TD>

</TR>

<TR bgcolor="#cccccc">
<TD align="left" width="13%>AAA<TD>
<TD align="left" width="13%">BBB</TD>
<TD align="left" width="13%">CCC</TD>
<TD align="left" width="20%">DDD</TD>
<TD align="left" width="20%">EEE</TD>
<TD align="left" width="20%">FFF</TD>
</TR>

<TR bgcolor="#eeeeee">
<TD colspan="5" align="left">NAME2</TD>
<TD colspan="1" align="left"><IMG src="../image/roundbutton.gif" width="18" height="18" border="0"> <A href="#" accesskey="v">View (V)</A></TD>
</TR>

<TR bgcolor="#eeeeee">
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%"><INPUT type="text" size="8" maxlength="8" value=0 name="newValue2" onfocus="this.oldValue=this.value;this.value=''" onblur='if(this.value=="")this.value=this.oldValue;addLumpSumValues(this);'></SPAN></TD>
</TR>


<TR bgcolor="#eeeeee">
<TD colspan="5" align="left">NAME3</TD>
<TD colspan="1" align="left"><IMG src="../image/roundbutton.gif" width="18" height="18" border="0"> <A href="#" accesskey="v">View (V)</A></TD>
</TR>

<TR bgcolor="#eeeeee">
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%"><INPUT type="text" size="8" maxlength="8" value=0 name="newValue3" onfocus="this.oldValue=this.value;this.value=''" onblur='if(this.value=="")this.value=this.oldValue;addLumpSumValues(this);'></SPAN></TD>
</TR>

<TR bgcolor="#eeeeee">
<TD colspan="5" align="left">NAME4</TD>
<TD colspan="1" align="left"><IMG src="../image/roundbutton.gif" width="18" height="18" border="0"> <A href="#" accesskey="v">View (V)</A></TD>
</TR>

<TR bgcolor="#eeeeee">
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%"><INPUT type="text" size="8" maxlength="8" value="0" name="newValue4" onfocus="this.oldValue=this.value;this.value=''" onblur='if(this.value=="")this.value=this.oldValue;addLumpSumValues(this);'></SPAN></TD>
</TR>

<TR>                                        
<TD align="right">
<TABLE>
<TBODY>
<TR>
<TD align="right">GBP</TD>
<TD align="right"><INPUT type="text"     size="8" maxlength="8" name="total" readonly value="0"></TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
</FORM>

</body>
</html>



0
squish2307Author Commented:
NetGroove,

that is fine, however, the function must be universal.  Hence in my original function I use, getElementsbByName(search).  This then gives me the 'upper bound' of the for loop.  I CANNOT have the upperbound hardcoded.  It is no-good to me, especially when I am using the same code in a number of pages of differing length.
0
squish2307Author Commented:
NetGroove, disregard my last comment.
0
squish2307Author Commented:
OK...

how comes the RegExp doesn't work?

NetGroove, thanks for your help.  It works, however, on a page I may have the following scenario:

<input name = newValue3>
<input name = newValue4>
<input name = newValue12>
<input name = newValue23>
<input name = newValue3>

Hence the use of the RegExp.


I know I am being a pain, but please stay with me.  It is difficult to show you exactly what I am trying to achieve using the internet.
0
squish2307Author Commented:
OH...

Could the fact the RegExp doesn't work have anything to do with the fact that all my functions are in a '.js' file which I load up at the beginning?
0
NetGrooveCommented:
I did not understood your problem with regexp, but how about checking for name prefix?
Like this:

<html>
<head>
<script>
var fieldPrefix = "newValue";
function addLumpSumValues(theField) {
 if(isNaN(theField.value)){
   theField.value = "0";
 }
 theField.value*=1;
 var totalval = 0;
 elem = theField.form.elements;
 for (i=0;i<elem.length;i++){
   if((elem[i].name+'').substr(0,fieldPrefix.length)==fieldPrefix){
     theVal=elem[i].value;
     var Y = parseInt(theVal);
     totalval = totalval + Y;
     totalval.toPrecision(2);
   }
 }
 document.aForm.total.value = totalval
}

</script>
</head>
<body>
<FORM name="aForm">
<TABLE cellpadding="1" cellspacing="4" width="100%">
<TBODY>
<TR bgcolor="#cccccc">
<TD align="left" colspan="5">NAME</TD>

<TD align="left">STUFF</TD>

</TR>

<TR bgcolor="#cccccc">
<TD align="left" width="13%>AAA<TD>
<TD align="left" width="13%">BBB</TD>
<TD align="left" width="13%">CCC</TD>
<TD align="left" width="20%">DDD</TD>
<TD align="left" width="20%">EEE</TD>
<TD align="left" width="20%">FFF</TD>
</TR>

<TR bgcolor="#eeeeee">
<TD colspan="5" align="left">NAME2</TD>
<TD colspan="1" align="left"><IMG src="../image/roundbutton.gif" width="18" height="18" border="0"> <A href="#" accesskey="v">View (V)</A></TD>
</TR>

<TR bgcolor="#eeeeee">
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%"><INPUT type="text" size="8" maxlength="8" value=0 name="newValue2" onfocus="this.oldValue=this.value;this.value=''" onblur='if(this.value=="")this.value=this.oldValue;addLumpSumValues(this);'></SPAN></TD>
</TR>


<TR bgcolor="#eeeeee">
<TD colspan="5" align="left">NAME3</TD>
<TD colspan="1" align="left"><IMG src="../image/roundbutton.gif" width="18" height="18" border="0"> <A href="#" accesskey="v">View (V)</A></TD>
</TR>

<TR bgcolor="#eeeeee">
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%"><INPUT type="text" size="8" maxlength="8" value=0 name="newValue3" onfocus="this.oldValue=this.value;this.value=''" onblur='if(this.value=="")this.value=this.oldValue;addLumpSumValues(this);'></SPAN></TD>
</TR>

<TR bgcolor="#eeeeee">
<TD colspan="5" align="left">NAME4</TD>
<TD colspan="1" align="left"><IMG src="../image/roundbutton.gif" width="18" height="18" border="0"> <A href="#" accesskey="v">View (V)</A></TD>
</TR>

<TR bgcolor="#eeeeee">
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="13%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%">NUM</TD>
<TD align="right" width="20%"><INPUT type="text" size="8" maxlength="8" value="0" name="newValue4" onfocus="this.oldValue=this.value;this.value=''" onblur='if(this.value=="")this.value=this.oldValue;addLumpSumValues(this);'></SPAN></TD>
</TR>

<TR>                                        
<TD align="right">
<TABLE>
<TBODY>
<TR>
<TD align="right">GBP</TD>
<TD align="right"><INPUT type="text"     size="8" maxlength="8" name="total" readonly value="0"></TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
</FORM>

</body>
</html>



0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
squish2307Author Commented:
I am going to split the points.  I have worked out a way that I can do this, but you guys gave me a lot of input.  I have marked the answers which I found were helpful.

Thanks.

Also, apologies for the question and for being quite hard to understand.
0
James RodgersWeb Applications DeveloperCommented:
thanks for the points!
0
NetGrooveCommented:
Thanks for the points.

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.