reading and incrementing a value
i have this code through which i'm reading hosts names from a file and displaying it into the dropdown menu .Now say i select for example a value "1.2.3.4" from the menu then i want that under "PORT" i should see say for ex :18000 ,Now when i choose another value from the menu "2.3.4.5" then the value in the PORT should by itself increment the previous value to say 19000 .How can i do that ? Plz help !! Let me know if more info is needed on this .
here is the code :
<td><select name="t_host" size="1" id="t_host" style="width:170px">
<% Set fs=Server.CreateObject("Scripting.FileSystemObject ")
Set f=fs.OpenTextFile(Server.MapPath("defaults1/hosts.dat"),1)
do while f.AtEndofStream = false
strLine = Trim(f.ReadLine)
If Len(strLine) > 0 Then
response.write "<option value=""" & Replace(strLine,"""",""") & """>" & strLine & "</option>"
End If
loop
f.Close
Set f=Nothing
Set fs=Nothing
%>
</select></td>
<tr><td> PORT</td>
<td><input type="text" name="t_port" id="t_port" class="textboxNormal"></td>
</tr>
|