gpt4 book ai didi

javascript - 根据输入表单中输入的内容分别弹出不同的表单

转载 作者:行者123 更新时间:2023-12-03 01:13:20 25 4
gpt4 key购买 nike

早上好,我修改了一些教程代码,使其分别针对在称为版本的输入表单中键入的版本名称显示不同的帐户创建表单。无论我在此处输入什么版本名称,都会出现完整版本的选项。我正在使用 bootstrap 和 jquery。这是什么问题?

                <?php  
if(isset($_SESSION['username']))
{
?>
<div align="center">
<h1>Welcome - <?php echo $_SESSION['username']; ?></h1><br />

<?php if ($_SESSION['version'] = "full") { ?>
<form action="fullfinalinserting.php" method="post" enctype="multipart/form-data">
<div class="row">
<div class="col-md-4 form-group">
<label for="name">Name</label>
<input type="text" id="name" name="name" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="yname"> Username</label>
<input type="text" id="yname" name="yname" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="url">Your Site URL</label>
<input type="text" id="url" name="url" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="email">Email</label>
<input type="email" id="email" name="email" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="contact1"></label>
<input type="text" id="contact1" name="contact1" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="contact2"></label>
<input type="text" id="contact2" name="contact2" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="contact3"></label>
<input type="text" id="contact3" name="contact3" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="contact4"></label>
<input type="text" id="contact4" name="contact4" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="farewell"></label>
<input type="text" id="farewell" name="farewell" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="ppname"></label>
<input type="text" id="ppname" name="ppname" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="color"></label>
<input type="color" id="color" name="color1" >
</div>
<div class="col-md-4 form-group">
<label for="color"></label>
<input type="color" id="color" name="color2" >
</div>
</div>
<div class="row">
<div class="col-md-12 form-group">
<label for="message"></label>
<textarea name="message" id="message" class="form-control " cols="30" rows="8" required></textarea>
</div>
</div>
<fieldset>
<legend></legend>
<input type="file" name="uploadfile" multiple class="btn btn-primary" required>
</fieldset>
<fieldset>
<legend></legend>
<input type="file" name="uploadfile2" multiple class="btn btn-primary" required>
</fieldset>
<div class="g-recaptcha" data-sitekey="6Ld_eGoUAAAAAN-KLDMr1b3Kepypf3OBp0hNWF_H"></div>
<div class="row">
<div class="col-md-6 form-group">
<input type="submit" value="Send Message" name="submit" class="btn btn-primary">
</div>
</div>
</form>

<a href="#" id="logout">Logout</a>
</div>
<?php
} else if ($_SESSION['version'] = "deluxe") { ?>


<form action="deluxefinalinserting.php" method="post" enctype="multipart/form-data">
<div class="row">
<div class="col-md-4 form-group">
<label for="name">Name</label>
<input type="text" id="name" name="name" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="yname">Username</label>
<input type="text" id="yname" name="yname" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="url"></label>
<input type="text" id="url" name="url" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="email"></label>
<input type="email" id="email" name="email" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="contact1"></label>
<input type="text" id="contact1" name="contact1" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="contact2"></label>
<input type="text" id="contact2" name="contact2" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="contact3"></label>
<input type="text" id="contact3" name="contact3" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="contact4"></label>
<input type="text" id="contact4" name="contact4" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="ppname"></label>
<input type="text" id="ppname" name="ppname" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="color"></label>
<input type="color" id="color" name="color1" >
</div>
<div class="col-md-4 form-group">
<label for="color"></label>
<input type="color" id="color" name="color2" >
</div>
</div>
<div class="row">

</div>
<fieldset>
<legend></legend>
<input type="file" name="uploadfile" multiple class="btn btn-primary" required>
</fieldset>
<div class="g-recaptcha" data-sitekey="6Ld_eGoUAAAAAN-KLDMr1b3Kepypf3OBp0hNWF_H"></div>
<div class="row">
<div class="col-md-6 form-group">
<input type="submit" value="Send Message" name="submit" class="btn btn-primary">
</div>
</div>
</form>

<?php
} else if ($_SESSION['version'] = "standard") { ?>

<form action="standardfinalinserting.php" method="post" enctype="multipart/form-data">
<div class="row">
<div class="col-md-4 form-group">
<label for="name">Name</label>
<input type="text" id="name" name="name" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="yname">Userbame</label>
<input type="text" id="yname" name="yname" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="url"></label>
<input type="text" id="url" name="url" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="email"></label>
<input type="email" id="email" name="email" class="form-control " required>
</div>

<div class="col-md-4 form-group">
<label for="ppname"></label>
<input type="text" id="ppname" name="ppname" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="color"></label>
<input type="color" id="color" name="color1" required>
</div>
<div class="col-md-4 form-group">
<label for="color"></label>
<input type="color" id="color" name="color2" required>
</div>
</div>
<div class="row">

</div>
<fieldset>
<legend></legend>
<input type="file" name="uploadfile" multiple class="btn btn-primary" required>
</fieldset>
<div class="g-recaptcha" data-sitekey="6Ld_eGoUAAAAAN-KLDMr1b3Kepypf3OBp0hNWF_H"></div>
<div class="row">
<div class="col-md-6 form-group">
<input type="submit" value="Send Message" name="submit" class="btn btn-primary">
</div>
</div>


</form>

<?php
} else if ($_SESSION['version'] = "premium") { ?>

<form action="premiumfinalinserting.php" method="post" enctype="multipart/form-data">
<div class="row">
<div class="col-md-4 form-group">
<label for="name">Name</label>
<input type="text" id="name" name="name" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="yname">Username</label>
<input type="text" id="yname" name="yname" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="url"></label>
<input type="text" id="url" name="url" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="email"></label>
<input type="email" id="email" name="email" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="contact1"></label>
<input type="text" id="contact1" name="contact1" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="contact2"></label>
<input type="text" id="contact2" name="contact2" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="contact3"></label>
<input type="text" id="contact3" name="contact3" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="contact4"></label>
<input type="text" id="contact4" name="contact4" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="farewell"></label>
<input type="text" id="farewell" name="farewell" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="ppname"></label>
<input type="text" id="ppname" name="ppname" class="form-control " required>
</div>
<div class="col-md-4 form-group">
<label for="color"></label>
<input type="color" id="color" name="color1" >
</div>
<div class="col-md-4 form-group">
<label for="color"></label>
<input type="color" id="color" name="color2" >
</div>
</div>
<div class="row">
<div class="col-md-12 form-group">
<label for="message"></label>
<textarea name="message" id="message" class="form-control " cols="30" rows="8" required></textarea>
</div>
</div>
<fieldset>
<legend></legend>
<input type="file" name="uploadfile" multiple class="btn btn-primary" required />
</fieldset>
<fieldset>
<legend></legend>
<input type="file" name="uploadfile2" multiple class="btn btn-primary" required />
</fieldset>
<div class="g-recaptcha" data-sitekey="6Ld_eGoUAAAAAN-KLDMr1b3Kepypf3OBp0hNWF_H"></div>
<div class="row">
<div class="col-md-6 form-group">
<input type="submit" value="Send Message" name="submit" class="btn btn-primary">
</div>
</div>
</form>

<?php
} }
else
{
?>
<div align="center">
<button type="button" name="login" id="login" class="btn btn-success" data-toggle="modal" data-target="#loginModal">Login</button>
</div>
<?php
}
?>
</div>
<br />
</body>
</html>

最佳答案

在条件中始终使用运算符,例如:

等于:==

不等于:!=

大于:>

对于较小的:<

大于或等于:>=

小于或等于:<=

例如:-

if(var1==var2){
//code block
}

抱歉英语不好。

关于javascript - 根据输入表单中输入的内容分别弹出不同的表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52127754/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com