Доброго времени суток
У меня есть форма, где есть select с подключенным справочником направлений через админку
Возникла проблема, надо ограничить выводимый список в select.
Все направления делятся на 4 категории и вот нужна категория с id 275(допустим)
<xsl:template match="group[@name = 'otdelenie']" mode="webforms">
<div>
<xsl:apply-templates select="field" mode="webforms-otdelenie"/>
</div>
</xsl:template>
<xsl:template match="field" mode="webforms-otdelenie">
<label>
<xsl:apply-templates select="." mode="webforms_required"/>
<xsl:value-of select="@title"/><xsl:text>:</xsl:text>
</label>
<xsl:apply-templates select="." mode="webforms_input_type"/>
</xsl:template>
<xsl:template match="field[@name = 'otdelenie']" mode="webforms_input_type">
<div class="stylized_select">
<select name="{@input_name}"
onchange="this.parentNode.getElementsByTagName('input')[0].value = this.options[this.selectedIndex].innerHTML;">
<xsl:if test="@multiple">
<xsl:attribute name="multiple">
<xsl:text>multiple</xsl:text>
</xsl:attribute>
</xsl:if>
<option value=""></option>
<xsl:apply-templates select="values/item" mode="webforms_input_type"/>
</select>
<div class="input_wrapper">
<input type="text" name="noname" value=""/>
</div>
</div>
</xsl:template>
Заранее спасибо =)
Я посмотрела, и поняла, что зачем я вообще спрашивала про ограничение?...(все-таки уже усталость сказывается)
Вывести-то я могу в select список, таким способом.
<xsl:template match="group[@name = 'otdelenie'][@pageId = '275']" mode="webforms">
<div>
<xsl:apply-templates select="field" mode="webforms-otdelenie"/>
</div>
</xsl:template>
<xsl:template match="field" mode="webforms-otdelenie">
<label>
<xsl:apply-templates select="." mode="webforms_required"/>
<xsl:value-of select="@title"/><xsl:text>:</xsl:text>
</label>
<xsl:apply-templates select="." mode="webforms_input_type"/>
</xsl:template>
<xsl:template match="field[@name = 'otdelenie' or @name = 'specialist']" mode="webforms_input_type">
<div class="stylized_select">
<select name="{@input_name}"
onchange="this.parentNode.getElementsByTagName('input')[0].value = this.options[this.selectedIndex].innerHTML;">
<xsl:if test="@multiple">
<xsl:attribute name="multiple">
<xsl:text>multiple</xsl:text>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="document('usel://razdely/273')/udata" mode="webforms_input_type"/>
<!-- <option value=""></option>
<xsl:apply-templates select="values/item" mode="webforms_input_type"/> -->
</select>
<div class="input_wrapper">
<input type="text" name="noname" value=""/>
</div>
</div>
</xsl:template>
<xsl:template match="udata" mode="webforms_input_type">
<xsl:apply-templates select="page" mode="webforms_input_type"/>
</xsl:template>
<xsl:template match="page" mode="webforms_input_type">
<option><xsl:value-of select="name"/></option>
</xsl:template>
И когда я заполняю форму и делаю ее отправку, на почту приходит письмо, информация приходит вся, но кроме названия Направления.
Я так понимаю, не заполняется field?
Поэтому вопрос как сделать, чтобы данные поля отправились или как сделать чтобы field "заполнялся"
Так... нет.. все-таки походу что-то не так ><
Я правильно прописала код?
<xsl:template match="field[@name = 'otdelenie']" mode="webforms_input_type">
<div class="stylized_select">
<select name="{@input_name}"
onchange="this.parentNode.getElementsByTagName('input')[0].value = this.options[this.selectedIndex].innerHTML;">
<xsl:if test="@multiple">
<xsl:attribute name="multiple">
<xsl:text>multiple</xsl:text>
</xsl:attribute>
</xsl:if>
<!-- <option value=""></option> -->
<option value="{document('usel://razdely/273')/udata}"></option>
<xsl:apply-templates select="values/item" mode="webforms_input_type"/>
</select>
<div class="input_wrapper">
<input type="text" name="noname" value=""/>
</div>
</div>
</xsl:template>