Jump to content

vinphetamin

Members
  • Posts

    32
  • Joined

  • Last visited

Posts posted by vinphetamin

  1. Like this:

    <%'------------------------------------'These Variables'------------------------------------selectWidth = 200    'width of select box in pixelsselectHeight = 200    'height of select box in pixelsselectAlpha = 80     'transparency of drop-down listselectBackgroundColor = "#00FF00"    'Background colour of drop down listselectHighlightColor = "#FF0000"     'background colour of option when mouse overselectTextHighlightColor = "#FFF"    'text colour of option when mouse over%><script language="javascript">	function showHide(){//  if(document.getElementById('mySelectBox').style.visibility=="hidden"){// 	 document.getElementById('mySelectBox').style.visibility='visible';//  }else{// 	 document.getElementById('mySelectBox').style.visibility='hidden';//  }	} function move_up() {// 	 scroll_clipper.scrollTop = 0; }</script><style>input{border:none;cursor:pointer;width:100%;padding:2;background-color:transparent;}#customSelect{border:1px solid #c0c0c0;cursor:pointer;}</style><body bgcolor=#33CC33><form name="myForm" method=post><div style="position: absolute;  z-index: 1" id="layer1"><div style="position: absolute;  z-index: 1; visibility:visible" id="mySelectBox"> <div id='scroll_clipper' style='filter:alpha(opacity=<%=selectAlpha%>);position:absolute; width:<%=selectWidth%>px; height: <%=selectHeight%>px; overflow-y:auto'>    <div id='scroll_text' style="background-color:<%=selectBackgroundColor%>;">       <table border="0" cellspacing=0 cellpadding=0 width="100%" id="table1"><%'------------------------------'DSN'------------------------------ set conn=server.createobject("ADODB.CONNECTION") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open(Server.Mappath("/db/northwind.mdb"))'------------------------------'Get data..'------------------------------ set rs = conn.execute("SELECT DISTINCT Country FROM Customers ORDER BY Country")   while not rs.eof  thisCountry = trim(rs(0))   %>           <tr onclick="document.myForm.country.value='<%=thisCountry%>';move_up();showHide();myForm.submit();" style="cursor:pointer;" color="#FFFFFF" onmouseout="this.bgColor='';this.style.color = '';" onmouseover="this.bgColor='<%=selectHighlightColor%>';this.style.color='<%=selectTextHighlightColor%>';">              <td style="padding:0 0 1 2;"><%=thisCountry%></td>           </tr>   <%rs.movenext  wEnd%>       </table>     </div> </div></div><input type="hidden" name="country" value="<%=trim(request("country"))%>" readonly /></div></form><%country = trim(request("country"))if country<>"" thensql="SELECT Customers FROM Customers WHERE country='" & country & "'"set rs=Server.CreateObject("ADODB.Recordset")rs.Open sql,conn %> <table width="100%" cellspacing="0" cellpadding="2" border="1"> <tr> <th>Customers</th> </tr> <%  do until rs.EOF   response.write("<tr>")   response.write("<td>" & rs.fields("Customers") & "</td>")   response.write("</tr>")  rs.MoveNext  loop%>  </table><% end if %><%'------------------------------'Close conn..'------------------------------  rs.close set rs = nothing  conn.close set conn = nothing%></body></html>

    ?

  2. Try and stop the page from being cached in the first place. Try putting this in the head of the page:

    <META HTTP-EQUIV="Pragma" CONTENT="no-cache"><META HTTP-EQUIV="Expires" CONTENT="-1">

  3. To remove the scrollbar(s) just alter the code fromoverflow-y : auto;tooverflow-y : none;or just delete it altogether.At the moment it is set to auto so it should only show if the list disappears beyond the viewable area.Is that what you meant?

  4. Yeah sorry about that, we closed the DSN conn and tried to use it again before reopening/declaring what conn was.I've moved the clean-up to the end of the script, try this one out:

    <%'------------------------------------'These Variables'------------------------------------selectWidth = 200    'width of select box in pixelsselectHeight = 200    'height of select box in pixelsselectAlpha = 80     'transparency of drop-down listselectBackgroundColor = "#00FF00"    'Background colour of drop down listselectHighlightColor = "#FF0000"     'background colour of option when mouse overselectTextHighlightColor = "#FFF"    'text colour of option when mouse over%><script language="javascript">function showHide(){ if(document.getElementById('mySelectBox').style.visibility=="hidden"){  document.getElementById('mySelectBox').style.visibility='visible'; }else{  document.getElementById('mySelectBox').style.visibility='hidden'; }}function move_up() {   //scroll_clipper.scrollTop = 0;}</script><style>input{border:none;cursor:pointer;width:100%;padding:2;background-color:transparent;}#customSelect{border:1px solid #c0c0c0;cursor:pointer;}</style><body bgcolor=#33CC33><form name="myForm" method=post><div style="position: absolute;  z-index: 1" id="layer1"><div style="position: absolute;  z-index: 1; left:0px; top:22px; visibility:hidden" id="mySelectBox"><div id='scroll_clipper' style='filter:alpha(opacity=<%=selectAlpha%>);position:absolute; width:<%=selectWidth%>px; height: <%=selectHeight%>px; overflow-y:auto'>   <div id='scroll_text' style="background-color:<%=selectBackgroundColor%>;">      <table border="0" cellspacing=0 cellpadding=0 width="100%" id="table1"> <% '------------------------------ 'DSN '------------------------------  set conn=server.createobject("ADODB.CONNECTION")  conn.Provider="Microsoft.Jet.OLEDB.4.0"  conn.Open(Server.Mappath("/db/northwind.mdb"))  '------------------------------ 'Get data.. '------------------------------  set rs = conn.execute("SELECT DISTINCT Country FROM Customers ORDER BY Country")    while not rs.eof   thisCountry = trim(rs(0))    %>            <tr onclick="document.myForm.country.value='<%=thisCountry%>';move_up();showHide();myForm.submit();" style="cursor:pointer;" color="#FFFFFF" onmouseout="this.bgColor='';this.style.color = '';" onmouseover="this.bgColor='<%=selectHighlightColor%>';this.style.color='<%=selectTextHighlightColor%>';">               <td style="padding:0 0 1 2;"><%=thisCountry%></td>            </tr>    <%rs.movenext   wEnd %>      </table>    </div></div></div><table border="0" cellpadding=0 cellspacing=0 width="<%=selectWidth%>" id="customSelect"><tr onclick="myForm.country.select();showHide();"> <td width="100%"><input type="text" name="country" value="<%=trim(request("country"))%>" readonly /></td> <td align="right">V</td></tr></table></div></form><%country = trim(request("country"))if country<>"" then sql="SELECT Customers FROM Customers WHERE country='" & country & "'" set rs=Server.CreateObject("ADODB.Recordset") rs.Open sql,conn  %>  <table width="100%" cellspacing="0" cellpadding="2" border="1">  <tr>  <th>Customers</th>  </tr>  <%   do until rs.EOF    response.write("<tr>")    response.write("<td>" & rs.fields("Customers") & "</td>")    response.write("</tr>")   rs.MoveNext   loop%>    </table><% end if %><% '------------------------------ 'Close conn.. '------------------------------   rs.close  set rs = nothing   conn.close  set conn = nothing%></body></html>

  5. You'll have to bear in mind that you'll probably be creating an infintite loop so you'd probably need to pass a variable round to counter-act it:

    <%if request("myVar")="" then response.redirect "?myVar=1"%>

    Also if you're trying to refresh the pages content you may want to look at doing it with java script:location.reload()or

    <script language="javascript"><!--if (location.search.indexOf("myVar")==-1){	location="?myVar";}//--></script>

  6. Try this:

    <%'------------------------------------'These Variables'------------------------------------	selectWidth = 200    'width of select box in pixels	selectHeight = 200    'height of select box in pixels	selectAlpha = 80     'transparency of drop-down list	selectBackgroundColor = "#00FF00"    'Background colour of drop down list	selectHighlightColor = "#FF0000"     'background colour of option when mouse over	selectTextHighlightColor = "#FFF"    'text colour of option when mouse over%><script language="javascript">	function showHide(){  if(document.getElementById('mySelectBox').style.visibility=="hidden"){ 	 document.getElementById('mySelectBox').style.visibility='visible';  }else{ 	 document.getElementById('mySelectBox').style.visibility='hidden';  }	} function move_up() {    //scroll_clipper.scrollTop = 0; }</script><style>	input{border:none;cursor:pointer;width:100%;padding:2;background-color:transparent;}	#customSelect{border:1px solid #c0c0c0;cursor:pointer;}</style><body bgcolor=#33CC33><form name="myForm" method=post><div style="position: absolute;  z-index: 1" id="layer1"><div style="position: absolute;  z-index: 1; left:0px; top:22px; visibility:hidden" id="mySelectBox"> <div id='scroll_clipper' style='filter:alpha(opacity=<%=selectAlpha%>);position:absolute; width:<%=selectWidth%>px; height: <%=selectHeight%>px; overflow-y:auto'>    <div id='scroll_text' style="background-color:<%=selectBackgroundColor%>;">       <table border="0" cellspacing=0 cellpadding=0 width="100%" id="table1">  <%  '------------------------------  'DSN  '------------------------------ 	 set conn=server.createobject("ADODB.CONNECTION") 	 conn.Provider="Microsoft.Jet.OLEDB.4.0" 	 conn.Open(Server.Mappath("/db/northwind.mdb"))    '------------------------------  'Get data..  '------------------------------ 	 set rs = conn.execute("SELECT DISTINCT Country FROM Customers ORDER BY Country")     while not rs.eof    thisCountry = trim(rs(0))   	 %>             <tr onclick="document.myForm.country.value='<%=thisCountry%>';move_up();showHide();myForm.submit();" style="cursor:pointer;" color="#FFFFFF" onmouseout="this.bgColor='';this.style.color = '';" onmouseover="this.bgColor='<%=selectHighlightColor%>';this.style.color='<%=selectTextHighlightColor%>';">                <td style="padding:0 0 1 2;"><%=thisCountry%></td>             </tr>   	 <%rs.movenext    wEnd  '------------------------------  'Close conn..  '------------------------------    rs.close 	 set rs = nothing    conn.close 	 set conn = nothing  %>       </table>     </div> </div></div><table border="0" cellpadding=0 cellspacing=0 width="<%=selectWidth%>" id="customSelect">	<tr onclick="myForm.country.select();showHide();">  <td width="100%"><input type="text" name="country" value="<%=trim(request("country"))%>" readonly /></td>  <td align="right">V</td>	</tr></table></div></form><%country = trim(request("country"))	if country<>"" then  sql="SELECT Customers FROM Customers WHERE country='" & country & "'"  set rs=Server.CreateObject("ADODB.Recordset")  rs.Open sql,conn 	 %> 	 <table width="100%" cellspacing="0" cellpadding="2" border="1"> 	 <tr> 	 <th>Customers</th> 	 </tr> 	 <%    do until rs.EOF   	 response.write("<tr>")   	 response.write("<td>" & rs.fields("Customers") & "</td>")   	 response.write("</tr>")    rs.MoveNext    loop 	 rs.close 	 conn.Close 	 set rs=Nothing 	 set conn=Nothing%> 	  	 </table>	<% end if %></body></html>

    You're going to need to modify the aesthetics of the table to make it look like a select box. (Meantime; I’ve put a V to represent an arrow).This form now submits when the user makes a selection. When the form is submitted country is posted as a variable which the code now checks for. If country is something then your code will run to look up the customers.I don’t have any database connectivity here so I couldn’t test this since I modified it. You’ll have to let me know how you get on.CheersVin

  7. I think it may have been the values:<tr onclick="document.myForm.country.value='<%=thisCountry%>';There were no quotes around them before.If you copy the following and save it as an asp page it should work.Can you try this and see if it works at your end:

    <%Dim testArray(50)	for i = 0 to 50  testArray(i)="Test country "&i	next%><script language="javascript">  showVar=null;  function showHide(){     if(document.getElementById('mySelectBox').style.visibility=="hidden"){           document.getElementById('mySelectBox').style.visibility='visible';     }else{           document.getElementById('mySelectBox').style.visibility='hidden';        }  }  function hideSelect(){     //setTimeout("document.getElementById('mySelectBox').style.visibility='hidden'",100)  }  function move_up() {     //scroll_clipper.scrollTop = 0;  }</script><body><form name="myForm"><div style="position: absolute;  z-index: 1" id="layer1"><div style="position: absolute;  z-index: 1; left:-1px; top:24px; visibility:hidden" id="mySelectBox">  <div id='scroll_clipper' style='filter:alpha(opacity=80);position:absolute; width:150px; height: 100px; overflow-y:auto'>     <div id='scroll_text' style="background-color:#00FF00;">        <table border="0" cellspacing=0 cellpadding=0 width="100%" id="table1">  <%  For i=0 to ubound(testArray)  thisCountry = testArray(i)       %>           <tr onclick="document.myForm.country.value='<%=thisCountry%>';move_up();showHide();" style="cursor:pointer;" color="#FFFFFF" onmouseout="this.bgColor='';this.style.color = '';" onmouseover="this.bgColor='#FF0000';this.style.color = '#ffffff';">              <td><%=thisCountry%></td>           </tr>           <%next%>        </table>      </div>  </div></div><input type="text" name="country" value="" readonly onclick="this.select();showHide();" onblur="hideSelect();" style="cursor:pointer;" /></div></div><br /><br /><input type=submit value="Show Customers" /></form></body></html>

    CheersVin

  8. Hi,yes, that was my mistake for changing the name of the text-box to 'country' following your code.Can you try this and see if this works:

    <script language="javascript">  showVar=null;  function showHide(){     if(document.getElementById('mySelectBox').style.visibility=="hidden"){           document.getElementById('mySelectBox').style.visibility='visible';     }else{           document.getElementById('mySelectBox').style.visibility='hidden';        }  }  function hideSelect(){     //setTimeout("document.getElementById('mySelectBox').style.visibility='hidden'",100)  }  function move_up() {     //scroll_clipper.scrollTop = 0;  }</script><body><form name="myForm"><div style="position: absolute;  z-index: 1" id="layer1"><div style="position: absolute;  z-index: 1; left:-1px; top:24px; visibility:hidden" id="mySelectBox">  <div id='scroll_clipper' style='filter:alpha(opacity=80);position:absolute; width:150px; height: 100px; overflow-y:auto'>     <div id='scroll_text' style="background-color:#00FF00;">        <table border="0" cellspacing=0 cellpadding=0 width="100%" id="table1"><%'------------------------------'DSN'------------------------------  set conn=server.createobject("ADODB.CONNECTION")     conn.Provider="Microsoft.Jet.OLEDB.4.0"     conn.Open(Server.Mappath("/db/northwind.mdb"))'------------------------------'Get data..'------------------------------  set rs = conn.execute("SELECT DISTINCT Country FROM Customers ORDER BY Country")       while not rs.eof     thisCountry = trim(rs(0))     %>           <tr onclick="document.myForm.country.value=<%=thisCountry%>;move_up();showHide();" style="cursor:pointer;" color="#FFFFFF" onmouseout="this.bgColor='';this.style.color = '';" onmouseover="this.bgColor='#FF0000';this.style.color = '#ffffff';">              <td><%=thisCountry%></td>           </tr>           <%rs.movenext     wEnd'------------------------------'Close conn..'------------------------------     rs.close  set rs = nothing     conn.close  set conn = nothing%>        </table>      </div>  </div></div><input type="text" name="country" value="" readonly onclick="this.select();showHide();" onblur="hideSelect();" style="cursor:pointer;" /></div></div><br /><br /><input type=submit value="Show Customers" /></form></body></html>

  9. <style>	a{cursor:pointer;}</style><form id="myForm">	<input type="text" name="myField" /></form><a onclick="document.getElementById('myForm').myField.value='One';">One</a><br /><a onclick="document.getElementById('myForm').myField.value='Two';">Two</a><br /><a onclick="document.getElementById('myForm').myField.value='Three';">Three</a><br />

  10. I think I understand your original request now.I added the following to your script:

    <form name="myForm" action="somepage.asp" method="post">	<%For Each Field In Request.Form%>  <input type="hidden" name="<%=Field%>" value="<%=request(Field)%>" />	<%Next%></form><script language="vbscript"><!--myForm.submit()//--></script>

    The whole script:

    <%Function ValidateField(sFieldValue, sFieldType)Dim bFieldIsOkaybFieldIsOkay = TrueSelect Case LCase(sFieldType)  Case "name"  If trim(Len(sFieldValue)) = 0 Then bFieldIsOkay = False  Case "email"  If Len(sFieldValue) < 5 Then    bFieldIsOkay = False  Else    If Instr(1, sFieldValue, " ") <> 0 Then    bFieldIsOkay = False    Else    If InStr(1, sFieldValue, "@") < 2 Then      bFieldIsOkay = False    Else      If InStrRev(sFieldValue, ".") < InStr(1, sFieldValue, "@") + 2 Then      bFieldIsOkay = False      End If    End If    End If  End If    Case "address"  If Len(sFieldValue) = 0 Then bFieldIsOkay = False  Case "city"  If Len(sFieldValue) = 0 Then bFieldIsOkay = False  Case "state"  If Len(sFieldValue) <> 2 Then bFieldIsOkay = False  Case "zip"  If Len(sFieldValue) <> 5 And Len(sFieldValue) <> 10 Then    bFieldIsOkay = False  End If      Case Else   bFieldIsOkay = FalseEnd SelectValidateField = bFieldIsOkayEnd FunctionSub ShowFormField(strField)%><TR>  <TD ALIGN="right"><B><%= strField %>:</B> </TD>  <TD><INPUT NAME="<%= strField %>" TYPE="text" VALUE="<%= Request.Form(strField) %>"></INPUT></TD>  <TD><%  If dictFields(LCase(strField)) Then  Response.Write "<IMG SRC=""C:\Inetpub\wwwroot\a.jpg"" BORDER=""0"" WIDTH=""25"" HEIGHT=""25"">"  End If  %></TD></TR><%End Sub%><%Dim Field      'looping variableDim dictFields 'dictionary for failed fieldsSet dictFields = Server.CreateObject("Scripting.Dictionary")  For Each Field in Request.FormIf ValidateField(Request.Form(Field), Field) = False Then  dictFields.Add LCase(Field), TrueEnd IfNext 'FieldIf Request.Form.Count <> 0 And dictFields.Count = 0 Then'???????????????????????????%><BR><BR><B>Here's what you entered:</B><BR><%For Each Field In Request.Form  Response.Write Field & ": " & Request.Form(Field) & "<BR>" & vbCrLfNext 'Field%><form name="myForm" action="somepage.asp" method="post">	<%For Each Field In Request.Form%>  <input type="hidden" name="<%=Field%>" value="<%=request(Field)%>" />	<%Next%></form><script language="vbscript"><!--myForm.submit()//--></script><%ElseIf Request.Form.Count <> 0 Then  %>  make sure thats your data is correct .  <%End If%><FORM ACTION="<%= Request.ServerVariables("Script_Name") %>" METHOD="post" NAME="TheForm"><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"><%ShowFormField("Name")ShowFormField("Email")ShowFormField("Address")ShowFormField("City")ShowFormField("State")ShowFormField("Zip")%></TABLE><INPUT TYPE="reset" VALUE="Reset The Form"></INPUT><INPUT TYPE="submit" VALUE="Submit The Form"></INPUT><BR><BR></FORM><%End If%>

    That script will redirect all the variables to another location (somepage.asp).However you could just put this in it's place:

    server.Transfer("somepage.asp")

    It'll do the same thing

  11. lol, what a mess.You know if all the pages are of the same domain you could just use server.Transfer as opposed to response.redirect.It basically pushes all the variables to another location.

  12. If i understand you correctly you may wish to try the following. It's not perfect but it's not far off:

    <script language="javascript">	showVar=null;	function showHide(){  if(document.getElementById('mySelectBox').style.visibility=="hidden"){ 	 document.getElementById('mySelectBox').style.visibility='visible';  }else{ 	 document.getElementById('mySelectBox').style.visibility='hidden';  }	}		function hideSelect(){  //setTimeout("document.getElementById('mySelectBox').style.visibility='hidden'",100)	}  function move_up() {    //scroll_clipper.scrollTop = 0;  }</script><body><form name="myForm"><div style="position: absolute;  z-index: 1" id="layer1"><div style="position: absolute;  z-index: 1; left:-1px; top:24px; visibility:hidden" id="mySelectBox">   <div id='scroll_clipper' style='filter:alpha(opacity=80);position:absolute; width:150px; height: 100px; overflow-y:auto'>    <div id='scroll_text' style="background-color:#00FF00;">	<table border="0" cellspacing=0 cellpadding=0 width="100%" id="table1"><%For s=1 to 100%>  <tr onclick="document.myForm.mySelect.value=<%=s%>;move_up();showHide();" style="cursor:pointer;" color="#FFFFFF" onmouseout="this.bgColor='';this.style.color = '';" onmouseover="this.bgColor='#FF0000';this.style.color = '#ffffff';"> 	 <td><%=s%></td>  </tr><%Next%>	</table>     </div>  </div></div><input type="text" name="mySelect" value="" readonly onclick="this.select();showHide();" onblur="hideSelect();" style="cursor:pointer;" /></div></div></div><br /><br /><input type=submit></form></body></html>

    Do something like this this for yours:

    <script language="javascript">   showVar=null;   function showHide(){      if(document.getElementById('mySelectBox').style.visibility=="hidden"){            document.getElementById('mySelectBox').style.visibility='visible';      }else{            document.getElementById('mySelectBox').style.visibility='hidden';         }   }	   function hideSelect(){      //setTimeout("document.getElementById('mySelectBox').style.visibility='hidden'",100)   }   function move_up() {      //scroll_clipper.scrollTop = 0;   }</script><body><form name="myForm"><div style="position: absolute;  z-index: 1" id="layer1"><div style="position: absolute;  z-index: 1; left:-1px; top:24px; visibility:hidden" id="mySelectBox">   <div id='scroll_clipper' style='filter:alpha(opacity=80);position:absolute; width:150px; height: 100px; overflow-y:auto'>      <div id='scroll_text' style="background-color:#00FF00;">         <table border="0" cellspacing=0 cellpadding=0 width="100%" id="table1"><%'------------------------------'DSN'------------------------------   set conn=server.createobject("ADODB.CONNECTION")      conn.Provider="Microsoft.Jet.OLEDB.4.0"      conn.Open(Server.Mappath("/db/northwind.mdb"))'------------------------------'Get data..'------------------------------   set rs = conn.execute("SELECT DISTINCT Country FROM Customers ORDER BY Country")        while not rs.eof      thisCountry = trim(rs(0))      %>            <tr onclick="document.myForm.mySelect.value=<%=thisCountry%>;move_up();showHide();" style="cursor:pointer;" color="#FFFFFF" onmouseout="this.bgColor='';this.style.color = '';" onmouseover="this.bgColor='#FF0000';this.style.color = '#ffffff';">               <td><%=thisCountry%></td>            </tr>            <%rs.movenext      wEnd'------------------------------'Close conn..'------------------------------      rs.close   set rs = nothing      conn.close   set conn = nothing%>         </table>       </div>   </div></div><input type="text" name="country" value="" readonly onclick="this.select();showHide();" onblur="hideSelect();" style="cursor:pointer;" /></div></div><br /><br /><input type=submit value="Show Customers" /></form></body></html>

    It still needs a function that's going to kill the focus if the user clicks away from the select list. Time permitting I will post it if I get the chance unless someone out there can help in the meantime.CheersVin

  13. If you were to do it in a form/select you could have used optgroup:

    <select>    <optgroup label="Spain">HELLO    <option>x</option>    <option>y</option>    <option>z</option>    </optgroup></select>

    The way you want to do it, you could specify ITEM as a variable and make it empty before you go into your loop. Then upon each loop check the past value against the current one. If it's different then write it out to the screen.something like:<%item=""while not YourRecordsetRS.eof if item<>YourRecordsetRS("item") then%> <td><%=YourRecordsetRS("item")%> </td> <%else%> <td> </td> <% item = YourRecordsetRS("item") YourRecordsetRS.movenextwEnd%>Just an idea. Any use?

  14. You could do this in an asp page or html or something else:

    <html><head><script language="vbscript"><!--  sub check(temp)    document.write("vbscript: "&temp)  end sub--></script></head><body><script language="javascript"><!--  var javaVar = 10;  document.write("javascript: "+javaVar+"<br />");  check(javaVar);//--></script></body></html>

  15. Voila....

    <html><head><script language="vbscript"><!--sub whatAge()    age = trim(age)     if isnumeric(age) then        document.write("You Are "& age &" Years Old!")        if age=30 then             alert("Congrats, You Are 30!!")        end if     end ifend subdim ageage=inputbox("Please enter your age")--></script></head><body><script type="text/vbscript">    call whatAge()</script></body></html>

  16. If i understand you correctly something like this perhaps:When you get your results from the database you could try concatenating two values as one...ie your select statement may look something like this:("SELECT timedeadline+'@@'+issuedate AS thisDate FROM timeissuedates ORDER BY unique")You could then use thisDate as the value for your drop-down-box.After the user changes the value of the drop-down the sub is called. The sub then gets the value of the drop-down and splits it in two values where @@ exists. It then updates the form with the values.

    <script language="vbscript"><!--    sub update()         iStr=trim(results.value)         if replace(iStr,"@@","")<>"" then             iExist=instr(iStr,"@@")             if iExist>0 then                iDate=right(iStr,len(iStr)-iExist-1)                iValue=left(iStr,iExist-1)             end if         else                iDate=""                iValue=""         end if         document.myForm.test.value=iDate         document.myForm.test2.value=iValue    end sub--></script><select onchange="update()" name="results">  <option value="">Please Select</option>  <option value="one@@01/01/2007">1</option>  <option value="two@@02/01/2007">2</option>  <option value="three@@03/01/2007">3</option></select><form name="myForm">     <input type=text name=test readonly />     <input type=text name=test2 readonly /></form>

×
×
  • Create New...