我有一个结帐页面,其中包含从php中的mySQL在while循环之后显示的一些信息,现在我希望这些信息在用户输入姓名和电子邮件并提交表单之前自动填写表单中的某些隐藏字段。 我是新来的,所以希望您的帮助。这是我的代码:
<div class="modulo" style="background-image: url(images/<?php echo $url; ?>)"></div>
<h2 class="h2 style black"><?php echo $taglio;?> <?php echo $style; ?></h2>
<p class="paragraph" id="prezzo">prezzo:<br><?php echo $prezzo;?> €</p>
<div class="simple-text icon">mq:<br><?php echo $mq;?></div>
<div class="simple-text maiusc prova" id="piano">piano: <?php echo $piano;?></div>
<div class="simple-text maiusc prova">mood: <?php echo $mood;?></div>
<div class="simple-text maiusc prova">finiture: <?php echo $finiture;?></div>
<div id="serv" class="simple-text maiusc prova">plus: 1, 2<br></div>
<form id="email-form-2" name="email-form-2" data-name="Email Form 2">
<input type="text" class="field-hidden w-input" maxlength="256" name="<?php echo $piano;?>" data-name="piano" placeholder="piano" id="piano">
<input type="text" class="field-hidden w-input" maxlength="256" name="<?php echo $mq;?>" data-name="mq" placeholder="mq" id="mq">
<input type="text" class="field-hidden w-input" maxlength="256" name="<?php echo $mood;?>" data-name="mood" placeholder="mood" id="mood">
<input type="text" class="field-hidden w-input" maxlength="256" name="<?php echo $finiture;?>" data-name="finiture" placeholder="finiture" id="finiture">
<input type="text" class="field-hidden w-input" maxlength="256" name="???" data-name="plus" placeholder="plus" id="plus">
<input type="text" class="field-hidden w-input" maxlength="256" name="<?php echo $prezzo_piano;?>" data-name="prezzo" placeholder="prezzo" id="price">
<label for="nome">nome:</label>
<input type="text" class="w-input" maxlength="256" name="nome" data-name="name" placeholder="inserisci il tuo nome" id="nome">
<label for="email">email:</label>
<input type="text" class="w-input" maxlength="256" name="email" data-name="Email" placeholder="inserisci la tua emal" id="email" required="">
<input type="submit" value="invia" data-wait="attendi" class="w-button">
谢谢!
答案 0 :(得分:1)
您应该使用:
value="<?php echo $piano;?>"
代替name="<?php echo $piano;?>
示例:
<input type="text" class="field-hidden w-input" maxlength="256" value="<?php echo $piano;?>" name="piano" placeholder="piano" id="piano">