Sunday, 15 July 2012

validation - What is the right way to replace an entire html code block from a structure? -


My problem is that I have one text field with one that has a wysiwyg editor.

Now, when the user presents the form and does not enter anything in the field then this is what is posted: & lt; Span class = "sceditor-selection" style = "row-height: 0; display: none;" Id = "sceditor-end-marker" gt; & Lt; / Span & gt; & Lt; Span class = "sceditor-selection" style = "row-height: 0; display: none;" Id = "sceditor-start-marker" & gt; & Lt; / Span & gt; & Lt; P & gt; & Lt; Br> & Lt; / P & gt;

Now, I want to require the field, and want to verify that the field is empty or not, but it is never really empty, because the editor is using that html Is located in

So though I would like to do something like this:

  & lt; For cfset search = "& amp; lt; span class = & amp; quot; sceditor-select & amp; quot; style = & amp; quot; line-height: 0; display: none; & amp; quot; ID = & amp; quot; sceditor-end-marker & amp; amp; & quot; & amp; gt; & amp; lt; / span & gt; & amp; duration class = & amp; quot; sceditor- Selection & amp; quot; style = & amp; quot; line-height: 0; display: none; & amp; quot; id = & amp; quot; scanner-start-marker & amp; quot; & gt; Amp; lt; / span & amp; gt; & amp; lt; p & gt; & lt; br & gt; & lt; / p & gt; "& gt; & Lt; Cfif StructKeyExists (params.event, "summary_an") & gt; & Lt; Cfset 'params.event.summary_en' = Change ('params.event.summary_en', '#searchfor #', "", "All") & gt; & Lt; / Cfif> & Lt; Cfif params.event.summary_en eq "" & gt; Error & lt; Cfelse & gt; Process & lt; / Cfif>   

However, the above params.event.summary_en "" or [empty string] does not set, as I want, params inside this parameter.Avent. Transfers to summary_en. Event.summary_en

So for some reason my above code is changing: & lt; Span class = "sceditor-selection" style = "row-height: 0; display: none;" Id = "sceditor-end-marker" gt; & Lt; / Span & gt; & Lt; Span class = "sceditor-selection" style = "row-height: 0; display: none;" Id = "scadder-start-marker" & gt; & Lt; / Span & gt; & Lt; P & gt; & Lt; Br> & Lt; / P & gt;

With this: params.event summary_yes

Why any idea is happening, and if I correctly state this recognition Am going about

Thank you.

The code below gives 'error' on CF10, 282462 which version of CF you use are doing?

  & lt; Cfset params.event.summary_en = '& lt; Span class = "sceditor-selection" style = "row-height: 0; display: none;" Id = "sceditor-end-marker" gt; & Lt; / Span & gt; & Lt; Span class = "sceditor-selection" style = "row-height: 0; display: none;" Id = "sceditor-start marker" & gt; & Lt; / Span & gt; & Lt; P & gt; & Lt; Br> & Lt; / P & gt; '/ & Gt; & Lt; Cfset searchfor = '& lt; Span class = "prescriptor-selection" style = "row-height: 0; display: none;" Id = "sceditor-end-marker" gt; & Lt; / Span & gt; & Lt; Span class = "sceditor-selection" style = "row-height: 0; display: none;" Id = "sceditor-start marker" & gt; & Lt; / Span & gt; & Lt; P & gt; & Lt; Br> & Lt; / P & gt; '& Gt; & Lt; Cfif StructKeyExists (params.event, "summary_an") & gt; & Lt; Cfset params.event.summary_en = Change (params.event.summary_en, Search, "", "All") & gt; & Lt; / Cfif> & Lt; Cfif params.event.summary_en eq "" & gt; Error & lt; Cfelse & gt; Process & lt; / Cfif>    

No comments:

Post a Comment