I have a select dropdown with a number value only but the user sees a descriptor for a service attached to the amount
<option value="400">New Report</option>
So long as the value is a pure #, all the javascript code I use runs all the calcs and totals nicely.
The issue is I can't figure out how to save the number and the descriptor at the same time so the form still calculates and I know the choice the user made.
If I include the text to be parsed with php later on to split the number from the text and save in 2 fields in the DB, my calc result is 'NaN' because text is present in the value field
I have tried to somehow split the number from the text in the onchange event, but that has not worked
eg
<select id="srv1" name="srv1" onChange="calcexp(this.form,str.split('srv1','-','0'));">
the idea is to draw from the value what is on the left of the dash.
as in
<option value="400-New Report">New Report</option>
split(). Alsostrdoesn't appear to be defined in code shown