Javascript calculation letters and numbers
<pre><code>&lt;SCRIPT Language = JavaScript&gt;
function calculate() {
a = 12
b = eval(document.form.number.value)
c = 5J7S
d = (a + b + c)
alert(d)

}
&lt;/SCRIPT&gt;

&lt;FORM NAME = form&gt;

Phone: &lt;INPUT TYPE = text SIZE = 3 value =""&gt;
-
&lt;INPUT TYPE = text name = number SIZE = 3 value =""&gt;
-
&lt;INPUT TYPE = text SIZE = 4 value =""&gt;

&lt;P&gt;
&lt;Input Type = Button NAME = b1 VALUE = "Grab Code" onClick = calculate() 

&lt;/FORM&gt;
</code></pre>

<p>5JG7S (Fixed Value)
<br>
5+7=12 (Added both numbers from Fixed Value)
<br>
Phone number 123-456-7890<br>
4+5+6=15 (Prefix added together)<br>
12+15=27 (Added numbers from the Fixed Value and the numbers that were added from the prefix)<br>
27+5JG7S=275JG7S (Those numbers were added to the beginning of the orginal Fixed Value)<br></p>

<p>Now this Script that I have:<br>
a is the added numbers from the Fixed Value<br>
b is the input from the form(phone number)<br>
c is the Fixed Value<br>
d is adding each one up so they will display the code as an alert.<br></p>

<p>Now, if I take out c and just add a and b it performs the addition, if c is in there, it stops the process and produces nothing.</p>

<p>My question is, how do we add the calculated number and append it to the beginning of the fixed value?</p>

<p>Also, the addition works, but not the way I want it to, I want to add the 3 numbers together, the javascript adds 456+12= 468</p>

<p>I know this is very simple code, I am not familiar with Javascript programming and I pretty much pieced together what I found from searching.</p>

<p>I hope this makes sense, if this is not possible I understand.</p>

<p>Thanks!</p>
