The syntax of cfscript is an implementation of the C/C++/Java/JavaScript
syntax ...
the problem you're running into isn't syntactical tho... You're trying to
reference elements of the JavaScript Document Object Model (DOM) on the
ColdFusion ( before the code reaches the browser ) where they don't exist
yet. The DOM is a JavaScript representation of the browser and what's it
contains.
CF or CFScript doesn't have a browser DOM because CF doesn't really know
anything about the browser or what it contains -- that's not it's job, it's
only job is to pass HTML and other client-side scripting to the browser for
it to interpret.
hth
Isaac
Certified Advanced ColdFusion 5 Developer
www.turnkey.to
954-776-0046
> I am having some trouble with some of my javascript
> Well my code works within
> <script></script> tages
> But when I put them in <Cfscript></cfscript> tags it
> doesn't here is the
> code:
> A couple functions I use throughouit my app::
> <cfscript>
> alert("Invalid SSN");
> window.parent.document.forms[0].SSN.select();
> </cfscript>
> <cfscript>
> window.parent.document.forms[0].first.value =
> '#firstname#';
> window.parent.document.forms[0].last.value =
> '#lastname#';
> </cfscript>
> <cfscript>
> alert("Invalid SSN Format");
> window.parent.document.forms[0].SSN.select();
> </cfscript>
> <script>
> function ConfirmSSN(sSSN)
> {
> document.all.WorkFrame.src = "confirmSSN.cfm?SSN=" +
> sSSN;
> }
> function enterinfo()
> {
> document.employee.lastname.value = retlname;
> document.employee.firstname.value = retfname;
> }
> </script>
> I thought that the syntax between javascript and cfscript
> was pretty
> much interchangeable?? What is my problem???
> Please help!
> Thanks
> -----Original Message-----
> From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 28, 2002 1:46 PM
> To: CF-Talk
> Subject: RE: Function?
>> Yes, you are right. I thought that she had wanted to do
>> javascript,
>> then serverside validation, and if something is wrong,
>> bring them back
>> to the input page with prefilled fields and alert them.
>> If nothing is
>> wrong, still bring them back to the input page, except
>> this time
>> instead of an alert message, display a submit button for
>> them to
>> click.
>> heh i'm sleepy i guess
> Actually, dependant upon the application, I could see a
> situation where
> it might be beneficial to take the contents of a single
> input field and
> pass or submit them to an action page in the onblur()
> event of the
> field, thus making allmost all visible content always
> current, and
> eliminating the need for a submit or save button.
> The only drawbacks are that it makes "undo" a little
> unwieldy and has
> the potential to drastically increase bandwidth and server
> resource
> usage as a result of sending dozens if not hundreds or
> thousands of page
> requests for such a tiny amount of data.
> But the idea is interresting and possibly viable, given
> circumstance.
> Isaac Dealey
> Certified Advanced ColdFusion 5 Developer
> www.turnkey.to
> 954-776-0046
> __________________________________________________________
> ____________
> Get the mailserver that powers this list at
> http://www.coolfusion.com
> FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
> Archives:
> http://www.mail-archive.com/[email protected]/
> Unsubscribe:
> http://www.houseoffusion.com/index.cfm?sidebar=lists
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists