javascript - How to make Hide/show button appear in a single input without Bootstrap -
i trying make following:
how place hide/show , generate links inside input field. without use of bootstrap, appreciated.
code below:
<script type="text/javascript" > var pwdwidget = new passwordwidget('thepwddiv','pass1'); pwdwidget.makepwdwidget(); </script> <noscript> <div> <input type="password" id="pass1" name="password" value="" placeholder="password" required <?php $reg_errors ?>/></div> </noscript> .container{ padding: 0 auto; width: 450px; margin: 180px 35% 0% 35%; } input[type=email]{ font-family: amsipro-xlight; background-color:#fff; /* border: 1px dotted #999;*/ float: right; /* margin: 2em 35% 0% 35%;*/ padding: 18px 20px; width: 400px; /* background-clip: padding-box;*/ border: 1px solid #fff; border-bottom-color: #fff; border-radius: 5px; } input[type=password]{ font-family: amsipro-xlight; background-color:#fff; /* border: 1px dotted #999;*/ float:right; /* margin: 10px 35% 0% 35%;*/ padding: 18px 20px; width: 400px; /* background-clip: padding-box;*/ border: 1px solid #fff; border-bottom-color: #fff; border-radius: 5px; } input[type=submit]{ font-family: amsipronarw-regular; text-align: center; background-color:#d5e16d; float: right; margin: 10px 0% 0% 5%; padding: 18px 20px; width: 100px; height: 50px; /* background-clip: padding-box;*/ border: 2px solid #a5a953; /* border-bottom-color: #142647;*/ border-radius: 8px; } /* show button */ input[type=button]{ font-family: amsipronarw-regular; /* text-align: center;*/ /* background-color:#fff;*/ float: right; /* margin: 10px 0% 0% 5%; padding: 18px 20px; width: 50px; height: 50px; background-clip: padding-box; border: 2px solid #a5a953; border-bottom-color: #142647; border-radius: 8px;*/ /* content:"\e105";*/ font-family: 'glyphicons halflings'; content:"\e105"; } title { display: none; } /*.pwdwidgetdiv { width:155px; } .pwdfield { width:150px; } */.pwdopsdiv{ display: block; float: left; margin-left:2%; color: #000; } .pwdopsdiv { font-family : amsipronarw-regular;; font-size : 1em; text-decoration: none; } /*hide/show password meter*/ .pwdstrengthbar{ float:right; background:#e86065; height:10px; margin-top:-10px; } .pwdstrength{ float:right; height:20px; width:300px; margin-top:15px; } /*password strength meter text*/ .pwdstrengthstr{ float:right; clear:both; height:14px; margin-top:-20px; font-family : amsipronarw-regular; font-size : 0.8em; } <section class="container"> <form class="form" method="post" action="reg_1.php" accept-charset="utf-8"> <!-- <div id="first">--> <input type="email" id="email" name="email" placeholder="email address" value=''> <br> <!-- hide/show generate password --> <div class='pwdwidgetdiv' id='thepwddiv'></div> <input type="password" id="pass2" name="password2" value="" placeholder=" confirm password" required <?php $reg_errors ?> <p class="remember_me"> </p> <p class="submit"><input type="submit" name="submit" value="register"></p> <br> </form> </section>
click change text? if/else text:
$('.showhide').click(function (e) { e.preventdefault(); $('.show').text(function (i, v) { return $this.is(':hidden') ? 'hide' : 'show' }) }); }); if want define , add button or text can have way (complex):


Comments
Post a Comment