7 users online. Create an account or sign in to join them.Users
Members Forms
This is an open discussion with 66 replies, filed under XSLT.
Search
BTW: I am at the Symposium 2011, so I don't find the time right now. But I will try and do it when I am back in Munich. If I don't response, feel free to post a reminder. Anything related to Members should "just work".
I thought about the duplicate ID issue mentioned by @ixi and posted an issue on Github.
@anybody: Correct me if I am wrong. I think that IDs are only used for:
- "mapping" an HTML label element to an input field
- creating CSS/JavaScript "hooks"
So IDs don't have to follow a naming scheme at all. You might use any value you want (as long as it is unique). So what I think about is add the ability to override auto-generated IDs in your form, like so:
<xsl:call-template name="members:input-identity">
<xsl:with-param name="event" select="$event"/>
<xsl:with-param name="id" select="'some-special-id'"/>
</xsl:call-template>
which will output:
<div class="input">
<label for="some-special-id">Username</label>
<input type="text" id="some-special-id" name="fields[username]" />
</div>
Downside: This makes the developer responsible as soon as two or more forms are used on the same page.
But: This solution also gives the greatest degree of freedom when it comes to IDs. Additionally, auto-generation of IDs will still work as before, so the solution would be completely backwards-compatible.
What does anybody think of the proposed solution? Any feedback is welcome.
Members Forms updated to version 1.1 on 24th of October 2011.
Members forms now allows to override auto-generated IDs for input fields. Additionally, you can manually pass an ID for the input type "submit" (which has no ID attribute by default).
Members Forms updated to version 1.1.1 on 26th of October 2011
That is a bugfix release, highly recommended if you use version 1.1!
Members Forms updated to version 1.1.3 on 11th of December 2011
Thanks to @Lewis for discovering an issue related to the example code.
Thanks Michael, I think that will help others.
Create an account or sign in to comment.
Hmm, duplicate IDs being generated is actually something I didn't notice, probably because I had only one form per page. I will look into it.