... |
... |
@@ -14,6 +14,7 @@
|
14 |
14 |
<?php $this->block('field'); ?>
|
15 |
15 |
<input type="text" name="<?= $this->name ?>" id="ctrl_<?= $this->id ?>" class="captcha mandatory<?php if ($this->class) echo ' ' . $this->class; ?>" value="" aria-describedby="captcha_text_<?= $this->id ?>"<?= $this->getAttributes() ?>>
|
16 |
16 |
<span id="captcha_text_<?= $this->id ?>" class="captcha_text<?php if ($this->class) echo ' ' . $this->class; ?>"><?= $this->getQuestion() ?></span>
|
|
17 |
+<input type="hidden" name="<?= $this->name ?>_hash" value="<?= $this->getHash() ?>">
|
17 |
18 |
|
18 |
19 |
<?php if (!$this->hasErrors()): ?>
|
19 |
20 |
<div style="display:none">
|
... |
... |
@@ -21,8 +22,15 @@
|
21 |
22 |
<input type="text" name="<?= $this->name ?>_name" id="ctrl_<?= $this->id ?>_hp" value="">
|
22 |
23 |
</div>
|
23 |
24 |
<script>
|
24 |
|
- document.getElementById('ctrl_<?= $this->id ?>').parentNode.style.display = 'none';
|
25 |
|
- document.getElementById('ctrl_<?= $this->id ?>').value = '<?= $this->getSum() ?>';
|
|
25 |
+ var e = document.getElementById('ctrl_<?= $this->id ?>'),
|
|
26 |
+ p = e.parentNode, f = p.parentNode;
|
|
27 |
+
|
|
28 |
+ if ('fieldset' === f.nodeName.toLowerCase() && 1 === f.children.length) {
|
|
29 |
+ p = f;
|
|
30 |
+ }
|
|
31 |
+
|
|
32 |
+ p.style.display = 'none';
|
|
33 |
+ e.value = '<?= $this->getSum() ?>';
|
26 |
34 |
</script>
|
27 |
35 |
<?php endif ?>
|
28 |
36 |
|