質問編集履歴
2
コードを追記しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,17 +24,21 @@
|
|
24
24
|
|
25
25
|
```HTML
|
26
26
|
|
27
|
-
<d
|
27
|
+
<{foreach from=$product.product_text_titles key=key item=val}>
|
28
28
|
|
29
|
-
<
|
29
|
+
<div class="text-titles-list__unit">
|
30
30
|
|
31
|
-
<
|
31
|
+
<span class="option-name text-titles-list__name"><{$val|escape}></span>
|
32
32
|
|
33
|
-
<i
|
33
|
+
<div class="input-border text-titles-list__detail">
|
34
34
|
|
35
|
-
<
|
35
|
+
<input type="text" name="product_text[<{$key|escape}>]" value="" onKeyUp="countLength(value, 'textlength');" class="text-titles-list__detail-text" />
|
36
36
|
|
37
|
+
</div>
|
38
|
+
|
37
|
-
<div class="item_desc txt_20"><p>:</p><p id="textlength">0</p><p>文字</p></div></div>
|
39
|
+
<div class="item_desc txt_20"><p>:</p><p id="textlength">0</p><p>文字</p></div></div>
|
40
|
+
|
41
|
+
<{/foreach}>
|
38
42
|
|
39
43
|
```
|
40
44
|
|
1
コードを追記しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -19,3 +19,35 @@
|
|
19
19
|
2.入力文字の中から「半角の(,)(.)(スペース)・全角の(、)(。)(スペース)」を引きたい
|
20
20
|
|
21
21
|
3.計算後の文字総数のみ表示させたい
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
```HTML
|
26
|
+
|
27
|
+
<div class="text-titles-list__unit">
|
28
|
+
|
29
|
+
<span class="option-name text-titles-list__name"><{$val|escape}></span>
|
30
|
+
|
31
|
+
<div class="input-border text-titles-list__detail">
|
32
|
+
|
33
|
+
<input type="text" name="product_text[<{$key|escape}>]" value="" onKeyUp="countLength(value, 'textlength');" class="text-titles-list__detail-text" />
|
34
|
+
|
35
|
+
</div>
|
36
|
+
|
37
|
+
<div class="item_desc txt_20"><p>:</p><p id="textlength">0</p><p>文字</p></div></div>
|
38
|
+
|
39
|
+
```
|
40
|
+
|
41
|
+
```JavaScript
|
42
|
+
|
43
|
+
<script language="JavaScript" type="text/JavaScript">
|
44
|
+
|
45
|
+
function countLength( text, field ) {
|
46
|
+
|
47
|
+
document.getElementById(field).innerHTML = text.length;
|
48
|
+
|
49
|
+
}
|
50
|
+
|
51
|
+
</script>
|
52
|
+
|
53
|
+
```
|