Giter Site home page Giter Site logo

form-controls's People

Contributors

brendo avatar davidoliver avatar nickdunn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

form-controls's Issues

attributes appended by default

Hello nick,

I have a question about this great tool. This utility appends the attributes title and value without any value by default?

Here is my template. Check out the result http://pastie.org/644087.

If the value wasn't defined it's not necessary to append these attributes, right?

Thanks in advance!

form:select issues

when using a select box link with the following code (using section schemas):

<xsl:call-template name="form:select">
    <xsl:with-param name="handle" select="name()"/>
    <xsl:with-param name="options">
        <option value="">Select a Country</option>
    </xsl:with-param>
</xsl:call-template>

With this XML:

no


Health
Firefly
Entertainment
Symphony


I get the following error:
XSLTProcessor::transformToXml(): xsl:attribute : node already has children

Multiple forms per page

Hi there, was wondering if somebody could help,

Despite following the instructions provided I'm still unable to have form controls functioning while having two seperate forms in my markup,

These are the errors i'm getting:

error

Thanks.

Submitting multiples entries for same section bug (eventEx)

Hi, first thanks a lot for your great job on form control, I'm working on a site with hundreds of form and I would certainly become mad without this utility.

I think I found a bug when submitting multiple entries of the same section with eventEx.

Let call the section 'mySection', the different entries submitted are 'mySection[0]' and 'mySection[1]'.

If the returning eventEx event contains error, then the first entry of the section ('mysection[0]') is not autopopulated as it should be.
I've been looking in the form control code, and I found out that the probleme was coming from line 1082 to1090 :

test="$event/entry[@section-handle=$section-handle and @index-key=$index-key]/post-values/[name()=$handle]/ "

This condition is never true for the firs entry (index-key=0). For a reason that I can not figure out, the @index-key is not available in the xml for this entry ( maybe this is an eventEx issue then?? ).

Do you have an idea about this issue ?

Thanks

form:select and Select Box (Link) IDs

I have a section which uses SB(L) fields for relationships with other sections. The data source XML that's used for a Members select frontend form field:

<members-titles>
    <section id="22" handle="members-titles">Members titles</section>
    <entry id="429">
        <title handle="dr">Dr</title>
    </entry>
    <entry id="430">
        <title handle="mr">Mr</title>
    </entry>
    <entry id="431">
        <title handle="ms">Ms</title>
    </entry>
</members-titles>

The readme for form-controls, form-select:

Each node passed to this parameter will be converted to an HTML option element. If the node has an attribute of the following names: handle, id, link-id, link-handle or value; these will be used as the value attribute of the option element. If none of these attributes is found, no value attribute will be appended. As in the above example, to achieve an empty value for the field (for validation, for example) add an empty value attribute to an option.

Because the SB(L) XML output has the id parameter on the parent of the node which I need to specify to the template, the ID number is not being assigned to the select option value parameter.

I've tried editing the form:select template to look for ../@id, but am not having any joy. I've also tried assigning the entry node in the parameter that's passed to the template, but then the title text() is not output for the option text.

form:checkbox-list doesn't respect 'class' param

example xslt:

<xsl:call-template name="form:checkbox-list">
    <xsl:with-param name="handle" select="'category'"/>
    <xsl:with-param name="class" select="'checkbox'"/>
    <xsl:with-param name="options">
        <category>Amateur</category>
        <category>Senior</category>
        <category>Professional</category>
    </xsl:with-param>
</xsl:call-template>

html output:

<label class="">
    <input id="fields-category" class="" type="checkbox" value="Amateur" title="" name="fields[category][]">Amateur
</label>
<label class="">
    <input id="fields-category" class="" type="checkbox" value="Senior" title="" name="fields[category][]">Senior
</label>
<label class="">
    <input id="fields-category" class="" type="checkbox" value="Professional" title="" name="fields[category][]">Professional
</label>

Problem with readme example

I copied the example, but it didn't work. I needed to add <input name="action[NAMEOFEVENT]" type="submit" value="Submit" />

form:textarea doesn't retain linebreaks

Nick, started using this for a new project. Really great stuff.

I've come across one limitation thus far which is that the form:textarea template doesn't retain the linebreaks when populating the value. It's happening because of the normalize-space functions use there, and is easily fixed by changing:

<xsl:variable name="initial-value" select="normalize-space($value)"/>

to:

<xsl:variable name="initial-value" select="$value"/>

However that causes there to be a discrepancy between the $postback-value and the $initial-value. Not sure of the best way to get around that—perhaps adding a param to the form:postback-value template to allow the non-normalised value to be returned?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.