5 users online. Create an account or sign in to join them.Users

Search

Is that right? If I have a checkbox that is ticked, it should display as Yes in the XML?

Tell me that’s right before I go insane.

Yes

Right, well my XML is showing the data as No.

Basically I have a Diary Dates section, and when the date/event has expired I check a box.

I also have a filter in the DS which Filters Diary Dates by Date Expired, and I have chosen No as the value.

I’m note sure I understand. So you’ve got entries with checkboxes that are ticked, but they’re filtering and outputting their value as ‘No’?

Yes.

What now? Yes or No? Hehe…

Never mind, Carry on. :-)

And you are filtering entries in your DS using the checkbox field, filtering to only show entries when their values are “No”?

Yes. And I have changed an entry to show Yes and it still shows as No in the XML.

But if you check the box and resave (giving it a “Yes” value) then it will no longer appear in your Data Source, since you are filtering “No”.

Well that is what I thought.

Update though is that it works - must have been cached or something.

So if the value in the XML is yes.. shouldn't the checkbox itself now by checked in the html of my form?

It shows as yes in my XML but I can't get it to appear as checked on the HTML side of things.. I'm targeting my value from the section like so:

/data/mysection/mycheckbox-field/

Should it be @value or something?

I'm targeting my value from the section like so

Not sure what you mean. Could you post your XSLT? It would be something like:

<input type="checkbox">
    <xsl:if test="/data/your-data-source/entry/your-checkbox-field='Yes'">
        <xsl:attribute name="checked">checked</xsl:attribute>
    </xsl:if>
</input>

The above code makes sense now, thanks Nick.. I'm creating the ability to edit forms on the front end.. so needed to get value from the entry when editing.

Hey Nick, As I am attempting to edit this entry from the front end, It seems to retain the checked status when I submit it with the value unchecked.. is there a way around this? I need the value reflected when the user edits but obviously want it to update and reflect the edited state which at present it seems to not do. :(

Ahah.. thanks Nick.

So it acts like an override I guess.

More like a fallback, yep.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.2 or above
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.0 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details