Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MAC OS and ColdFusion

Status
Not open for further replies.

boatguy

Programmer
Joined
Oct 22, 2001
Messages
153
Location
US
I have a client that states she is not able to make changes in her administration pages. I have tested them on 10 separate PC's running various OS, but she is on a MAC and I don't have access to one. She states that she enters new text into the text box, submits the form and it doesn't update the database. Anyone ever have this problem? Code is attached for the form page and the update page.

FORM

<HTML>
<HEAD><TITLE>Edit</TITLE></HEAD>
<BODY bgcolor=&quot;White&quot;>
<CFINCLUDE Template=&quot;Chklogin.cfm&quot;>


<CFQUERY NAME=&quot;homepage&quot; datasource=&quot;#bfschools#&quot;>
SELECT *
FROM homepage
WHERE schoolname = '#user_schoolname#'
</CFQUERY>



<CFFORM NAME=editwood ACTION=&quot;DataUpdate.cfm?UserAction=Edit&quot;&quot; ENCTYPE=&quot;&quot;multipart/form-data&quot;>
<CFOUTPUT QUERY=&quot;homepage&quot;><input type=&quot;Hidden&quot; name=&quot;schoolname&quot; value=&quot;#schoolname#&quot;>

<center><h1>#schoolname# - Edit Record</h1></center>

<table cellspacing=&quot;2&quot; cellpadding=&quot;2&quot;>

<TR><TD ALIGN=right>Main Header: </TD>
<TD><cfinput type=&quot;Text&quot; name=&quot;mainheader&quot; value=&quot;#mainheader#&quot; message=&quot;Please enter the Main Header Text!&quot; required=&quot;Yes&quot; size=&quot;100&quot; maxlength=&quot;100&quot;>
</TD></TR>


<TR><TD ALIGN=right>Sub Header: </TD>
<TD><cfinput type=&quot;Text&quot; name=&quot;subheader&quot; value=&quot;#subheader#&quot; message=&quot;Please enter the Sub Header Text&quot; required=&quot;Yes&quot; size=&quot;100&quot; maxlength=&quot;100&quot;>
</TD></TR>


<TR><TD ALIGN=right>Image Name: </TD>
<TD><cfinput type=&quot;Text&quot; name=&quot;image1&quot; value=&quot;#image1#&quot; message=&quot;Please enter the image name&quot; required=&quot;Yes&quot; size=&quot;50&quot; maxlength=&quot;50&quot;>
</TD></TR>


<TR><TD ALIGN=right>Image Title: </TD>
<TD><cfinput type=&quot;Text&quot; name=&quot;imagetitle&quot; value=&quot;#imagetitle#&quot; message=&quot;Please enter the image title!&quot; required=&quot;Yes&quot; size=&quot;50&quot; maxlength=&quot;50&quot;>
</TD></TR>

<TR><TD ALIGN=right>Home Page Text: </TD>
<TD><textarea name=&quot;pagecopy&quot; rows=&quot;9&quot; cols=&quot;60&quot;>#pagecopy#</textarea>
</TD></TR>




</tr>
</table></cfoutput>
<br>
<CENTER><INPUT TYPE=&quot;submit&quot; VALUE=&quot;Update This Record&quot;></CENTER>
</CFFORM>


UPDATE<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 3.2 Final//EN&quot;>

<HTML>
<HEAD>
<CFIF UserAction IS &quot;Edit&quot;>
<TITLE>Record is Updated</TITLE>
<CFELSE>
<TITLE>Record is Created</TITLE>
</CFIF>

</HEAD>
<BODY bgcolor=&quot;White&quot;>



<CFQUERY NAME=update DATASOURCE=&quot;#bfschools#&quot;>
UPDATE homepage
SET
schoolname = '#schoolname#',
mainheader = '#mainheader#',
subheader = '#subheader#',
image1 = '#image1#',
imagetitle = '#imagetitle#',
pagecopy = '#pagecopy#'

WHERE schoolname = '#schoolname#'
</CFQUERY>

<CFQUERY NAME=&quot;picturepage&quot; datasource=&quot;#bfschools#&quot;>
SELECT *
FROM picturepage
WHERE schoolname = '#schoolname#'
</CFQUERY>
<center><h1>The record has been Updated</h1></center>
<center><h1><a href=&quot;menu.cfm?member_id=<cfoutput query=&quot;picturepage&quot;>#schoolname#&quot;</cfoutput>>Back to Menu</a></h1></center>




 
Does your client receive any errors from her browser, or does she receive a success/failure message from your code?

The problem may be the variable #schoolname# is not being successfully passed to the action code in her case, causing the SET SQL command to fail.

Just a few ideas, will keep looking....
 
Hi,
You should trim your variables when inserting them. Mac versions of IE like to throw carriage returns or weird characters at the end. When you query the database it doesn't return the results as they have the crap after them, but they are in the database if you actually open it. Found that out the hard way...
Code:
<CFQUERY NAME=update DATASOURCE=&quot;#bfschools#&quot;>
        UPDATE homepage
        SET
            schoolname = '#Trim(schoolname)#',
            mainheader = '#Trim(mainheader)#',
            subheader = '#Trim(subheader)#',
            image1 = '#Trim(image1)#',
            imagetitle = '#Trim(imagetitle)#',
            pagecopy = '#Trim(pagecopy)#'
            
        WHERE schoolname = '#Trim(schoolname)#'
    </CFQUERY>
Macs using IE do even wilder stuff if you're uploading from the browser, search this forums older items for help in that area if you run into problems, as it was delt with a while ago.
Best of luck,
PT

ptmon_sm_ribbon.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top