Dreamweaver Club Forums

Dreamweaver Club Forums (http://www.dreamweaverclub.com/forum//index.php)
-   ASP (http://www.dreamweaverclub.com/forum//forumdisplay.php?f=187)
-   -   Set Appointments (http://www.dreamweaverclub.com/forum//showthread.php?t=35726)

MKelly 04-07-2010 07:19 PM

Set Appointments
I am wondering if there is a way to create a form with a select list of dates/times for appointments with a database connected (this is already done) and once published on web when someone choses a date/time, that date/time will no longer be available to the next person that goes on the website.

Thanks for any help.


mangofreak 04-07-2010 10:48 PM

Well, that's doable. However, we need to know what platform are you working on PHP/MySQL ASP/Access ASP/MSSQL

A quick way to do it would be to using conditional statements like:

if time X = 1 then display read only or not display. Plus you could affect it with CSS and change color.

More info would help.

edbr 04-08-2010 04:23 AM

might pay to look for an event calendar there may , though may be a long shot , something that would suit your purpose.

MKelly 04-09-2010 01:01 PM

I am using Asp(Dreamweaver)/Access. I think an event calendar is more than what I need. I am very new to ASP/Access and have muttled my way through quite nicely. Every once in a while I get in over my head, that is where I am right now. Thanks for any help you can give. Let me know if you need any other information.


mangofreak 04-09-2010 04:36 PM

ok. you could use a conditional statement that checks if the time slot is already booked.

I don't know the details of your db so it is hard to give you a clearer idea.

Can you elaborate more, what do you have so far? any code? How is the time divided, by the hour?

MKelly 04-09-2010 05:00 PM

Here is my coding for Dw

<form name="SAsessions" method="post" action="Appointments.asp">
<legend>International Services Appointment</legend>

<label for="UIN" class="required">UIN: <em>*</em></label>

<span id="sprytextfield1">
<input type="text" name="UIN" id="UIN" />
<span class="textfieldRequiredMsg">UIN is required.</span><span class="textfieldInvalidFormatMsg">UIN is 9 numbers begining with 814</span></span><br />
<label for="FirstName" class="required">First Name: <em>*</em></label>
<span id="sprytextfield2">
<input type="text" name="FirstName" id="FirstName" />
<span class="textfieldRequiredMsg">First Name is required.</span></span><br />
<label for="LastName" class="required">Last Name: <em>*</em></label>
<span id="sprytextfield3">
<input type="text" name="LastName" id="LastName" />
<span class="textfieldRequiredMsg">Last Name is required.</span></span><br />

<label for="Appointment" class="required">Appointment Time: <em>*</em></label>
<span id="spryselect1">
<select name="Appointment" id="Appointment">
<option value="">Select an Appointment Time</option>
<option value="Tuesday February 16th, 2:00-3:00 PM">Tuesday February 16th, 2:00-3:00 PM</option>
<option value="Tuesday March 16th, 1:00-2:00 PM">Tuesday March 16th, 1:00-2:00 PM</option>
<option value="Thursday April 1st, 4:00-5:00 PM">Thursday April 1st, 4:00-5:00 PM</option>
<span class="selectRequiredMsg">Please select an appointment time.</span></span><br />

<div align="center"><input name="Submit" type="submit" value="Submit Registration" /></div>
<script type="text/javascript">
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "custom", {pattern:"814000000", hint:"814######", useCharacterMasking:true, validateOn:["blur"]});
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "none", {validateOn:["blur"]});
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "none", {validateOn:["blur"]});
var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {validateOn:["blur"]});
<% else %>
<h3 align="center">Thank you setting an appointment with International Services. We look forward to meeting with you.</h3>
<% end if %>

My database is simple. 4 fields: UIN, FirstName, LastName, Appointment. I have nothing else in the database. Does the coding take place in dreamweaver of in Access?

mangofreak 04-09-2010 06:15 PM

You could compare if the appointment date you are inputing is already in use:


<%Dim newDate

newDate = Request.Querystring("Appointment")

if newDate = (rsCategories.Fields.Item("Apointment")) then

response.write "this date is not available"
end if


However, more detail is required. Can you post some of your recordset code. Or your a link to see what you have.

MKelly 04-09-2010 06:21 PM

recordset code
I hope this what you need. Thanks for your help.

<!--#include virtual="includes/protect.asp"-->
<!--#include file="../connections/dbcon.asp"-->

Submitted = False
if request.form("Submit") <> "" then
set rsRegistration = server.CreateObject("ADODB.Recordset")
rsRegistration.activeconnection = con
rsRegistration.cursorlocation = 3
rsRegistration.cursortype = 3
rsRegistration.locktype = 3
rsRegistration.source = "SELECT Top 1 * FROM Appointments"
if rsRegistration.recordcount > 0 then
for each obj in rsRegistration.fields
if obj.name <> "ID" then
rsRegistration(obj.name) = request.form(obj.name)
end if
Submitted = True
end if
set rsRegistration = nothing
end if

mangofreak 04-09-2010 06:25 PM

I hope so. As I said, It would help to know how the rest of your scheduling thing works. The code is not right, but you could test it adjusting the recordset name, the idea is there. It is not a solution though.

MKelly 04-09-2010 07:06 PM

Basically all I want is a form where we provide days and times where students can sign up if they would like to meet with our Assistant Director. The Dw form that I have sent you works fine as far as being able to enter data on the web form and the data sending to the Access database. We need the form to be able to eliminate appointments that are already taken. I'm not sure what else to provide you to give you the information you need so that you can give me the information I need. Like I said, I am very new to all of this. I have felt very capable until today. I have only been working in Dw and asp coding for about 3 weeks and am completely self taught. I would be happy to give you what you need, I am just not sure what that is.


All times are GMT. The time now is 10:26 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com