A
A
anton_trofimov952020-06-04 18:55:00
PHP
anton_trofimov95, 2020-06-04 18:55:00

Text not being sent from select?

There is such a form

<form action="" id="calculate-form">
                <div class="app-flex">
                    <div class="app-flex__item">
                        <div class="app-title">
                            Выберите материал из списка
                        </div>
                        <div class="select">
                            <select v-model="selected" name="?">
                                <option v-for="option in options" :value="option.value" name="?">
                                    {{ option.text }}
                                </option>
                            </select>
                        </div>
                        <div class="value-wrapper">
                            <div class="value-ton">Объем в тоннах <div>{{totalTon}}</div>
                            </div>
                            <div class="value-sum">Итого <div>{{total}} руб.</div>
                            </div>
                        </div>
                        <input type="hidden" :value="total" name="total">
                        <input type="hidden" :value="totalTon" name="totalton">
                    </div>
                    <div class="app-flex__item">
                        <div class="app-title">
                            Укажите нужный объем в м3
                            <input type="number" name="valuem3" id="" v-model="number">
                        </div>
                        <div class="app-title">
                            Укажите адрес доставки
                            <input type="text" placeholder="Введите адрес доставки" name="adress">
                        </div>
                        <div class="app-title">
                            Укажите телефон для связи
                            <input type="text" placeholder="+7-999-999-99-99" name="phone">
                        </div>
                    </div>
                </div>
                <div class="button">
                    <button>Отправить</button>
                </div>
            </form>


There is a php handler
<?php

$recepient = "[email protected]";
$siteName = "Ajax-форма";

$phone = trim($_POST["phone"]);
$option = trim($_POST["option"]);
$total = trim($_POST["total"]);
$totalton = trim($_POST["totalton"]);
$valuem3 = trim($_POST["valuem3"]);
$adress = trim($_POST["adress"]);
//$title = trim($_POST["order"]);

$message = "Телефон: $phone \nОпция: $option \nСтоимость: $total \nВтоннах: $totalton \nВм3: $valuem3 \nАдрес: $adress";

$pagetitle = "Заявка с сайта \"$siteName\"";
mail($recepient, $pagetitle, $message, "Content-type: text/plain; charset=\"utf-8\"\n From: $recepient");

?>


Everything except the name of the option {{option.text}} comes to the mail. How to do it, I do not understand. I already assigned name to everything, I can’t get through. How to do?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
galaxy, 2020-06-04
@galaxy

From select comes the value of the selected option, nothing else

A
Anton Shamanov, 2020-06-04
@SilenceOfWinter

name="?"invalid selector name

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question