Is this possable

I know nothing is inpossable but i have i think a tricky thing to do, any and all help is welcome.<br />
<br />
What i want to do is this if someone types a number etc<br />
2A59IZ1DC-00 I want it to separate them like 2A59I Z1 DC-00 and display the information like<br />
2A59I = chipset, Z1 = Manufacturer, DC = The model number -00 is ignored<br />
So the above numbers would work out to this 2A59I stands for the Intel Triton TX chipset, Z1 stands for Zida/Tomato and DC is the model if known.<br />
I am a little stuck how to make this work i have all the information such as chipsets models etc but i want to make it into an easy to use way.<br />
I want to do this myself I just need a few ideas on how to accomplish this.<!--content-->Will the string always be in the form 522-2 (where the numbers mean the number of characters)? Because if so then this would do it:<br />
<br />
<br />
<br />
<script type="text/javascript"><!--<br />
<br />
var userinput="2A59IZ1DC-00"<br />
<br />
var chipset=userinput.indexOf(0,6);;<br />
var manufacturer=userinput.indexOf(6,8);<br />
var modelnum=userinput.indexOf(8,10);<br />
<br />
//--></script><br />
<br />
Then you would need an array of data (or preferably a server-side database if you have server-side capabilities) and use the separated out strings to find the required information. The client-side script for that might look a little like this:<br />
<br />
<br />
<br />
<script type="text/javascript"><!--<br />
<br />
var everything=new Array();<br />
<br />
everything["chipset"][everything["chipset"].length]=new Array("2A59I","Intel Triton TX");<br />
<br />
everything["manufacturer"][everything["manufacturer"].length]=new Array("Z1","Zida/Tomato");<br />
<br />
everything["modelnum"][everything["modelnum"].length]=new Array("DC","Unknown");<br />
<br />
for(var n=0;n<everything["chipset"].length;n++){<br />
if(everything["chipset"][n][0]==chipset){chipset=everything["chipset"][n][1];break;}<br />
}<br />
<br />
for(var n=0;n<everything["manufacturer"].length;n++){<br />
if(everything["manufacturer"][n][0]==manufacturer){manufacturer=everything["manufacturer"][n][1];break;}<br />
}<br />
<br />
for(var n=0;n<everything["modelnum"].length;n++){<br />
if(everything["modelnum"][n][0]==chipset){modelnum=everything["modelnum"][n][1];break;}<br />
}<br />
<br />
alert("Chipset is: "+chipset+"\nManufacturer is: "+manufacturer+"\nModel Number is: "+modelnum);<br />
<br />
//--></script><br />
<br />
Sorry I can't explain it fully right now but I will later. For now that's the best I can do, it's untested so it may not work properly (or at all).<!--content-->Their could be upto about 400 combinations for manufacturer and about the same for chipsets etc.<br />
<br />
they will all be in the same format regarless of manufacturer or chipsets<br />
<br />
Did try the snippet of code but not sure exactly what to do with it.<!--content-->
 
Back
Top