从divs中显示的mysql内容自动填充表单隐藏字段

hfyxw5xn  于 2021-06-20  发布在  Mysql
关注(0)|答案(1)|浏览(295)

我有一个结帐页,其中显示了一些信息,在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">

谢谢您!

mcdcgff0

mcdcgff01#

您应该使用: 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">

相关问题