Osclass Support Forums
Osclass plugin support => Attributes Plugins => Topic started by: Ashwathy Achu on July 01, 2018, 01:38:19 PM
-
Multilanguage Attributes Plugin Phone number field how to change like this?
-
Type of input must be "phone". Layout depends on browser and device.
-
How to change input type ? TEXT to TEL
-
@Ashwathy
Select attribute field to be Phone number.
-
please understand my question
-
First input field -TEXT
second input field - TEL
I want Multilanguage Attributes Plugin Phone number field like second one
-
IMAGE 1 - First input field -TEXT
IMAGE 2 - First input field -TEL
-
in file:
/oc-content/plugins/attributes/functions.php
find line:
} else if ($a['s_type'] == 'TEXT' || $a['s_type'] == 'PHONE' || $a['s_type'] == 'EMAIL' || $a['s_type'] == 'URL') {
$html .= '<input type="' . strtolower($a['s_type']) . '" id="atr_' . $a['pk_i_id'] . '" name="atr_' . $a['pk_i_id'] . '" placeholder="' . atr_input_placeholder($a['s_type']) . '" value="' . $item_atr['s_value'] . '" ' . $required . '/>';
replace with:
} else if ($a['s_type'] == 'TEXT' || $a['s_type'] == 'PHONE' || $a['s_type'] == 'EMAIL' || $a['s_type'] == 'URL') {
$input_type = strtolower($a['s_type'] == 'PHONE' ? 'TEL' : $a['s_type']);
$html .= '<input type="' . $input_type . '" id="atr_' . $a['pk_i_id'] . '" name="atr_' . $a['pk_i_id'] . '" placeholder="' . atr_input_placeholder($a['s_type']) . '" value="' . $item_atr['s_value'] . '" ' . $required . '/>';
-
Not working
-
After change, input type is "tel"
<div class="control-group atr-type-phone" id="atr-phone"><label class="control-label" for="atr6">Contact Phone</label><div class="controls"><input type="tel" id="atr_6" name="atr_6" placeholder="+" value=""></div></div>
-
Where to add
-
If you ask such question, you've probably have not followed guide I've sent you.
-
Check
http://prntscr.com/k240gc
-
Yes and if you select attribute of type phone, it will have input type tel.
-
After change, input type is "tel"
<div class="control-group atr-type-phone" id="atr-phone"><label class="control-label" for="atr6">Contact Phone</label><div class="controls"><input type="tel" id="atr_6" name="atr_6" placeholder="+" value=""></div></div>
First where to add this code
-
in file:
/oc-content/plugins/attributes/functions.php
find line:
} else if ($a['s_type'] == 'TEXT' || $a['s_type'] == 'PHONE' || $a['s_type'] == 'EMAIL' || $a['s_type'] == 'URL') {
$html .= '<input type="' . strtolower($a['s_type']) . '" id="atr_' . $a['pk_i_id'] . '" name="atr_' . $a['pk_i_id'] . '" placeholder="' . atr_input_placeholder($a['s_type']) . '" value="' . $item_atr['s_value'] . '" ' . $required . '/>';
replace with:
} else if ($a['s_type'] == 'TEXT' || $a['s_type'] == 'PHONE' || $a['s_type'] == 'EMAIL' || $a['s_type'] == 'URL') {
$input_type = strtolower($a['s_type'] == 'PHONE' ? 'TEL' : $a['s_type']);
$html .= '<input type="' . $input_type . '" id="atr_' . $a['pk_i_id'] . '" name="atr_' . $a['pk_i_id'] . '" placeholder="' . atr_input_placeholder($a['s_type']) . '" value="' . $item_atr['s_value'] . '" ' . $required . '/>';
Not working this code
-
How to solve?
-
From plugin point of view, everything is as it shoul (input type = tel).
-
okay But there are no changes
-
look this attribute plugin image
First image type email address
Second image type website address
-
Well you may contact your phone support or operating system support to change keyboard layout.
-
I try at a lot of phones but nothing change
-
you need FTP details?
-
No, I am not mobile keyboard developer.
-
I know you're not mobile keyboard developer.
-
You can find all supported input types by html here:
https://www.w3schools.com/Html/html_form_input_types.asp
-
finally problem solved
-
finally problem solved
How did you decide to enter numbers in the phone field can ?