That'll teach me to reply at 1am after a long day! I'm very puzzled as to
how the one with the form outside Cfoutput works at all - you should be
setting the action to exactly the string you quote, including the # marks.
I've seen a fairly simple set of rules for when you need to use cfoutput and
when you do not, but I thought that in an html tag if you wanted cf
variables translated you HAD to put it inside cfoutput.

I'm not so sure that cf server parses everything (well, maybe it does, but
does it always pay attention?). However I agree about setting colors that
#rrggbb will not work.

When you say option 2 does not work, what happens? Do you have any other
working edit handlers? I've got several edit handlers working - below is the
simplest one I have and it works fine. Hopefully you can compare yours and
this one to see if you can spot anything.


<cfa_handler object = "FAQ">
 <cfoutput>
  <cfif IsDefined ("form.pass")>
   <cfa_ContentObjectData
    datasource=#request.cfa.objectstore.dsn#
    objectID=#FAQ.objectID#>
    <cfa_ContentObjectProperty
     name="label"
     value=#form.label#>
    <cfa_ContentObjectProperty
     name="question"
     value=#form.question#>
    <cfa_ContentObjectProperty
     name="answer"
     value=#form.answer#>
   </cfa_ContentObjectData>
   <cflocation url=#form.returnto#>
  <cfelse>
   <form name="textform" action="#cgi.script_name#?#cgi.query_string#"
method="post">
    <input type="hidden"
     name="returnto"
     value="#cgi.script_name#?objectid=#url.objectid#">
    <input type="hidden"
     name="pass"
     value="1">

    <table border="1"
     bgcolor="ccddcc"
     align="center">
     <tr>
      <td>
       <b>Object ID :</b>
      </td>
      <td>
       <b>#FAQ.ObjectID#</b>
      </td>
     </tr>
     <tr>
      <td>
       <b>Type ID :</b>
      </td>
      <td>
       <b>#FAQ.TypeID#</b>
      </td>
     </tr>
     <tr>
      <td width="20%">
       <b>Label :</b>
      </td>
      <td width="80%">
       <input type="text" size="40" name="label" value="#FAQ.Label#">
       <br>
      </td>
     </tr>
     <tr>
      <td valign="top">
       <b>
        Question :&nbsp;
       </b>
      </td>
      <td>
       <textarea name="Question" class="size2"
        cols="60" rows="5">#trim(FAQ.Question)#</textarea>
      </td>
     </tr>
     <tr>
      <td valign="top">
       <b>
        Answer :&nbsp;
       </b>
      </td>
      <td>
       <textarea name="Answer" class="size2"
        cols="60" rows="5">#trim(FAQ.Answer)#</textarea>
      </td>
     </tr>
     <tr>
      <td align="center"
       colspan="2">
       <input type="Submit" value="Save Changes" name="btnSubmit">
       &nbsp;&nbsp;
       <input type="Button"
        value="Cancel"
        onClick="location='#cgi.script_name#?objectid=#url.objectid#'">
      </td>
     </tr>
    </table>
   </form>
  </cfif>
 </cfoutput>
</cfa_handler>


Hope this helps,

Alan Ford



-----Original Message-----
From: Jonathan Lim <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Friday, July 07, 2000 10:26 AM
Subject: RE: [Edit handlers] Do you need form or cfform?


>That's what I would have expected too. However, the code with the form
>outside _works_! So this is more a question about how the handlers work.
>
>BTW AFAIK I can put CF variables inside tags. The CF Server parses
>everything. That's why you have to markup your #AAFFAA as ##AAFFAA right?
>
>Thanks.
>Jon
>
>-----Original Message-----
>From: Alan Ford [mailto:[EMAIL PROTECTED]]
>Sent: 07 July 2000 00:07
>To: [EMAIL PROTECTED]
>Subject: Re: [Edit handlers] Do you need form or cfform?
>
>
>Hi,
>
>I hope the answer is as obvious as I think it is. You are using cold fusion
>notation within an html tag. Since the bits between the # marks are
supplied
>by the CF server, but the CF server is not normally looking for work to do
>inside html tags, you have to put the <form> inside a cfoutput tag to get
>the CF server to pay attention and replace the #xxxx# values.
>
>If you were using cfform instead, CF server knows it has to look at cfform,
>since it is a CF tag not an HTML tag. I doubt that you would have to put a
>similar cfform inside cfoutput tags.
>
>Regards,
>
>Alan Ford
>
>
>-----Original Message-----
>From: Jonathan Lim <[EMAIL PROTECTED]>
>To: '[EMAIL PROTECTED]' <[EMAIL PROTECTED]>
>Date: Thursday, July 06, 2000 7:22 PM
>Subject: [Edit handlers] Do you need form or cfform?
>
>
>>Hi,
>>
>>Trying to code an edit handler, which is a single page self-submitting
>form.
>>
>>We have encountered a strange problem...
>>
>>Code 1:
>><form action="#cgi.script_name#?objectID=#News.objectID#" method="POST">
>><CFOUTPUT>
>>...
>></CFOUTPUT>
>></form>
>>
>>Code 2:
>><CFOUTPUT>
>><form action="#cgi.script_name#?objectID=#News.objectID#" method="POST">
>>...
>></form>
>></CFOUTPUT>
>>
>>The first code works. The second one does not.
>>
>>Why?
>>
>>Cheers,
>>Jon
>>
>>--
>>Jonathan Lim [EMAIL PROTECTED]
>>Netdecisions http://www.netdecisions.co.uk/
>>--------------------------------------------------------------------------
-
>---
>>To Unsubscribe visit
>http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/spectra_tal
k
>or send a message to [EMAIL PROTECTED] with
>'unsubscribe' in the body.
>>
>
>---------------------------------------------------------------------------
-
>--
>To Unsubscribe visit
>http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/spectra_tal
k
>or send a message to [EMAIL PROTECTED] with
>'unsubscribe' in the body.
>---------------------------------------------------------------------------
---
>To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/spectra_talk
or send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body.
>

------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/spectra_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to