Callum,

Try this outside of the tables...

[#NewReg.getUsername()#] if there are no spaces or tabs between the [ and
the ], then it will appear to be in the formatting of the tables themselves.
For example you might have code before the input tag that is actually
causing the problem! 


 
Regards
Andrew Scott
Technical Consultant

NuSphere Pty Ltd
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9686 0485  -  Fax: 03 9699 7976


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Callum McGillivray
Sent: Monday, 4 April 2005 1:19 PM
To: [email protected]
Subject: [CFCDev] get Methods - HELP !

Hi all,

Just a very quick question for you all.  I am having problems with using get
and set methods inside a CFC and it's driving me crazy.

I can set a string variable as such;
<CFSCRIPT>
    NewReg.setUsername("abc");
</CFSCRIPT>

This will execute the following lines of code in the NewReg CFC.

<CFFUNCTION NAME="setUsername" ACCESS="public" RETURNTYPE="void">
    <CFARGUMENT NAME="Username" TYPE="string" REQUIRED="true">
    <CFSCRIPT>
        variables.username = '#Arguments.Username#';
    </CFSCRIPT>
</CFFUNCTION>

However, when I then call the NewReg.getUsername() method in the same CFC, I
seem to be getting tabs or something appended to the front of the string.

For reference purposes, I have appended the code used in the get method
also;

<CFFUNCTION NAME="getUsername" ACCESS="public" RETURNTYPE="string">
        <CFRETURN variables.username>
</CFFUNCTION>

This is quite odd, because if I use the Len() function on the value returned
from this call I get the number 3 returned, and the following code evaluates
to "True";

NewReg.getUsername() IS "abc"

However when I output the code in the HTML form field, I get a box with two
tabs before the beginning of the string.
(Please note this is only occuring in IE)

When I examine the source for the web page, I see this;

<INPUT NAME="username" TYPE="text" ID="username" VALUE="
        callummc">

While firefox seems to be ignoring the line break and tabs that are added to
this, IE does not...

Whilst this may on the face of things appear to be a browser issue, my
questions is why is ColdFusion adding tabs and line breaks where there are
none ?

If someone can help me out here I would really appreciate it... my head is
starting to hurt.

Cheers,

Callum






----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]







----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]


Reply via email to