• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

If structure??? confusin

Participant ,
May 19, 2006 May 19, 2006

Copy link to clipboard

Copied

Hello to all.....I have a few questions about how to structure my <cfif> </cfif> tags...I have a <select> and i named it "vider" and i have an <input type= text> and the control name is "loca".....Now the values that are in my select are data values that i pull from my SQL tables and i am wondering how can i check for certain text in the <select></select>...this is what i have so far...




<html>
<head>
<title>EMOI Electronic Fee Slip</title>
<meta https-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript" src="../../choosedate.js"></script>
<link type="text/css" rel="stylesheet" href="../../calendar.css">
<link href="../style.css" rel="stylesheet" type="text/css">
</head>

<body>


<cfset tdate = DayOfWeek(Now())>
<cfif IsDefined("ydate")>
<cfif IsDefined("vider")>

<cfif FORM.vider IS "Mr. Me Too">
<cfif tdate IS 1>

<cfset ydate = DateFormat(DateAdd("d", +2, Now()), "MM/DD/YYYY")>
<cfset loca = "Surgery">
</cfif>
</cfif>
</cfif>

<cfelseif tdate IS 2>
<cfset ydate = DateFormat(DateAdd("d", +2, Now()), "MM/DD/YYYY")>
<cfset loca = "to this">
<cfelseif tdate IS 3>
<cfset ydate = DateFormat(DateAdd("d", +2, Now()), "MM/DD/YYYY")>
<cfset loca = "Something">
<cfelseIf tdate IS 4>
<cfset ydate = DateFormat(DateAdd("d", +2, Now()), "MM/DD/YYYY")>
<cfset loca = "Something 3">
<cfelseif tdate IS 5>
<cfset ydate = DateFormat(DateAdd("d", +4, Now ()), "MM/DD/YYYY")>
<cfset loca = "Something 4">

<cfelseif tdate IS 6>
<cfset ydate = DateFormat(DateAdd("d", +4, Now ()), "MM/DD/YYYY")>
<cfset loca = "Something 5">

<cfelse>
<cfset ydate = DateFormat(DateAdd("d", +2, Now()), "MM/DD/YYYY")>
</cfif>





<cfquery datasource="bashful_emoi" name="res">
Select * From Patients where doc_code ='RA' and date_seen LIKE '%#ydate#' Order By last_name ASC
</cfquery>

<br>
<br>

<table border=0 cellspacing=0 cellpadding="4px" align="center" height="1" bordercolor="#3399FF" >

<tr>
<td height="15px" background="topline.gif" class="lefttopbottom"><b><center>Name</center></b></td>
<td height="15px" background="topline.gif" class="topbottom"><b><center>Appointment Date</center></b></td>
<td height="15px" background="topline.gif" class="toprightbottom"><b><center>Provider</center></b></td>
<td height="15px" background="topline.gif" class="toprightbottom"><b><center>Location</center></b></td>
</tr>

<cfoutput query="res">
<tr>
<td class="leftrightbottom">#res.last_name#,#res.first_name#</td>
<td align="center" class="rightbottom">#res.date_seen#</td>
<td aligm="center" class="rightbottom"><select name="vider"><option>#res.provider#</option></select></td>
<td align="center" class="rightbottom"><input type="text" size="20" name="location" value="#loca#"></td>
</tr>
</cfoutput>


</table>





<br>
<Center>
<table>
<tr>
<td>

<input type="submit" value="Call People" border="1" width="300 x" align="bottom"style="font-size:10pt;width:100px;height:30px">
</td>
</tr>
</center>
</table>

</table>

</body>
</html>
TOPICS
Advanced techniques

Views

396

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 19, 2006 May 19, 2006

Copy link to clipboard

Copied

First of all, use the "Attach Code" button at the bottom of the text area for your message and indent to make your code more readable. Second, use "AND" in your CFIF statement, like below. Is this logic really what you want? It looks strange.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 19, 2006 May 19, 2006

Copy link to clipboard

Copied

I get an error saying Invalid construct when i set the tdate value to equal 4......any one with help on where the error is coming from??? what did i do wrong???

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 19, 2006 May 19, 2006

Copy link to clipboard

Copied

Where do i need to place my </cfif> tag so that i can meet these conditions throughout my whole application

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 19, 2006 May 19, 2006

Copy link to clipboard

Copied

The </CFIF> goes after the last <CFELSEIF>. Also, your <cfset DateFormat(DateAdd("d", +4, Now()), "MM/DD/YYYY"> is wrong - it is not being assigned to a variable. You should do
<cfset foo = DateFormat(DateAdd("d", +4, Now()), "MM/DD/YYYY">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 19, 2006 May 19, 2006

Copy link to clipboard

Copied

See this is what happens when U go from coding VB.Net and C# to something totally new which is what i am doing...thanks for bearing with me!!! sorry for the beginer error but when i did add those varibles and i check in the browser for the changes...Now i just get that the page cannot be displayed???? I dont know why......thanks for the help j..... would you know of any good coldfusion books????

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 19, 2006 May 19, 2006

Copy link to clipboard

Copied

The ColdFusion MX 7 Web Application Construction Kit at http://www.forta.com/books/ is considered by most people to be the definitive work on ColdFusion.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 19, 2006 May 19, 2006

Copy link to clipboard

Copied

YEa i have that bok and it is great but they dont show you how to do anything that may take some thinking but the overall feel of the book is a classsic....But have you ever heard of the page not showing up like how my previous post stated....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 19, 2006 May 19, 2006

Copy link to clipboard

Copied

LATEST
Overcomplicated. Try using cfswitch.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation