Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 3rd, 2004, 11:41 PM
Registered User
 
Join Date: Nov 2003
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Inserting dates in forms


Hello everybody,

I am trying to create a list of dates into a HTML form in dreamweaver.Is there a easy way to insert dates into a list rather then entering each dates from 1950-2004.
Your help will be appreciated.

cheers
zulf

 
Old November 4th, 2004, 04:57 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

If I understand you correctly, no there isn't. If you add items to a drop-down list in Dreamweaver, you'll manually need to add the items to your page.

However, if you're using a dynamic / server side technology, like ASP, PHP, JSP or whateverP, you can set up a loop that fils the drop-down with the dates for you.

Or, if you have the dates somewhere in a database, you can bind the drop-down to a recordset so the items get added at run-time automatically.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old November 22nd, 2004, 02:20 PM
Registered User
 
Join Date: Nov 2004
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well,dynamic page will work good. for example:

<select name="">
<%
i=1950
j=2004
do while i<=j
%>
<option><%=i%></option>
<%
i=i+1
loop
%>
</select>


however,you have another way to solve the problem using javascript, for example:


<script language="javascirpt">
<!--
i=1950;
j=2004;
document.write "<select>";
while (i<=j)
{
document.write "<option>"+i+"</option>";
i+=1;
}
document.write "</select>";
//-->
</script>




Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem when inserting dates jhansib4u SQL Server DTS 1 January 28th, 2008 11:06 AM
Opening forms from other forms Paulsh Access VBA 1 September 30th, 2004 06:54 PM
Inserting data from forms sarah82 Access 3 July 12th, 2004 08:45 AM
Inserting forms fields into Access tsparker Classic ASP Databases 1 October 9th, 2003 03:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.