Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it L'avatar di diegoctn
    Registrato dal
    May 2001
    Messaggi
    2,118

    data corrente su una select name

    Ciao ragazzi vorrei che apparisse in automatico sempre il giorno corrente:
    codice:
    <select name="giorno"> 
    <%  for ctInd=1 to 31  %> 
    <option value="<%=ctInd%>"><%=ctInd%></option> 
    <% next %> </select> </div> </td> 
    <td width="10%">
    <div align="center"> 
    <select name="mese"> 
    <% for ctInd=1 to 12 %> 
    <option value="<%=ctInd%>"><%= monthName(ctInd)%></option> 
    <% next %> </select> </div> </td> 
    <td width="6%"> 
    <div align="center"> 
    <select name="anno"> 
    <% for ctInd=datePart("yyyy",now) to datePart("yyyy",now) - 100 step -1 %> 
    <option value="<%=ctInd%>"><%=ctInd%></option> 
    <% next %> 
    </select>
    Al momento si imposta su 1 gennaio 2006

    Consigli? grazie, come sempre e a buon rendere

  2. #2
    <select name="giorno">
    <% for ctInd=1 to 31 %>
    <option value="<%=ctInd%>" <% if day(date)= ctind then response.write "selected" end if %>><%=ctInd%></option>
    <% next %> </select> </div> </td>
    <td width="10%">
    <div align="center">
    <select name="mese">
    <% for ctInd=1 to 12 %>
    <option value="<%=ctInd%>" <% if month(date)= ctind then response.write "selected" end if %>><%= monthName(ctInd)%></option>
    <% next %> </select> </div> </td>
    <td width="6%">
    <div align="center">
    <select name="anno">
    <% for ctInd=datePart("yyyy",now) to datePart("yyyy",now) - 100 step -1 %>
    <option value="<%=ctInd%>" <% if year(date)= ctind then response.write "selected" end if %>><%=ctInd%></option>
    <% next %>
    </select>

  3. #3
    Utente di HTML.it L'avatar di diegoctn
    Registrato dal
    May 2001
    Messaggi
    2,118
    GRAZIE MILLE!!

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.