通过动画形式获取数据到PHP?

时间:2018-11-24 00:10:55

标签: javascript php

所以我的HTML代码中包含以下动画形式。

- (NSString*) facilityName
{
    if (!_facilityName)
        _facilityName = FacilityNameFromID(self.id);
    return _facilityName;
}

您可以看到每个元素都是可单击的元素,然后将您带到表单的下一部分。我的目标是在提交时将用户单击的每个元素都通过php并使用$ _POST发送到操作页面。我曾尝试使用jQuery来检测单击元素的时间,然后将该值转移到隐藏的输入中并从中获取数据,但是我似乎无法正确理解。

<form id="formElem" name="formElem" action="" method="post">
                        <fieldset class="step">
                            <legend>Consultation</legend>
                            <p>
                                <input class = "consultation" type="submit" value="General Consultation">
                            </p>
                            <p>
                                <input class = "consultation" type="submit" value="Blood Test with Consultation">
                            </p>
                            <p>
                                <input class = "consultation" type="submit" value="Full Sexual Health Screen">
                            </p>
                             <p>
                                <input class = "consultation" type="submit" value="Hair Loss PRP Treatment">
                            </p>
                             <p>
                                <input class = "consultation" type="submit" value="Executive Health Screening">
                            </p>
                             <p>
                                <input class = "consultation" type="submit" value="Flu Vaccination">
                            </p>
                            <p>
                                <input class = "consultation" type="submit" value="Other">
                            </p>

                                <input type="hidden" name="consultation" id="consultation" value="">
                        </fieldset>

                        <fieldset class="step">
                            <legend>Provider</legend>
                             <p>
                                <input class = "provider" type="submit" value="Dr. Kevin O'Connell">
                            </p>
                             <p>
                                <input class = "provider" type="submit" value="Dr. Rachel Fitxgerald">
                            </p>
                             <p>
                                <input class = "provider" type="submit" value="Dr. Simon Gilmore">
                            </p>
                            <p>
                                <input class = "provider" type="submit" value="Nurse Julie Byrne">
                            </p>

                                <input type="hidden" name="provider" id="provider" value="">
                        </fieldset>
                        <fieldset class="step">
                            <legend>Date</legend>
                            <p>
                                <input type="date" name="date">
                            </p>
                             <p class="submit">
                                <button id="registerButton" type="submit">Confirm</button>
                            </p>
                        </fieldset>

                        <fieldset class="step">
                            <legend>Confirm</legend>
                            <p>
                                Thank you for requesting an appointment. We will be in touch with you shortly to confirm it.
                            </p>
                            <p class="submit">
                                <button id="registerButton"type="submit">Home</button>
                            </p>
                        </fieldset>
                    </form>

如果有人可以帮助我了解为什么我的代码无法正常工作或提供更有效的解决方案,我将不胜感激

0 个答案:

没有答案