I have following HTML code. writer input field is text filed. but I want to pretend that one is password field. whenever someone type anything, one key will display as * only, as you know how password field show; additionally the entry at writer input field should be populate in holder value which field is hidden. Can you please write in simple java script coding.
Password: <input type="text" id="writer" value=""/><input type="hidden" id="holder" value=""/>
This one show http://www.symplik.com/password.html, whatever we enter, it doesn't look good, it should be all * only when you start typing in it.
Simply use <input type="password" id="txtPassord" value=""/>
Related
I'm currently working on a project fiddling with animations on select and was creating a signup form (re-created it on my replit - https://replit.com/join/gzflphmalc-jeezgeorge
)
Everything seems to be working fine except for the fact that when I click on the name of the label (name, email, password) it doesn't initiate the text input.
How can I wrap the label with the input so that when I click on the name as well it will initiate the input.
Thanks in advance. :)
I don't have a Replit account so I can't see your project. But if I understand your question, you can use id and for HTML attributes for that:
<label for="name">First Name</label>
<input id="name" type="text" placeholder="e.g. John Doe" />
Once you click on the label First Name, it will focus on the text input.
I have tried below plugin to make password textbox value visible after each character input
https://github.com/better-owlet/jquery-mobilePassword/blob/master/js/jquery.mobilePassword.js is not working properly(characters are overlapping) when we type fast. any one has solution for the same.
plugin using below:
https://github.com/better-owlet/jquery-mobilePassword/blob/master/js/…
in JSP I am calling method
$("input[type=password]").mobilePassword();
<input name="password" type="password" class ="input" size="10">`
I have MySQL table templates, which looks like:
template_id|template_subject|template_text
------------------------------------------
1 |some subject |very long text with html
These are displayed in <select> dropdown and complete form looks like:
<form method="post" action="">
<select name="template_id"><option></option><option value="1">some subject</option></select>
<input type="text" name="template_subject">
<textarea name="template_text"></textarea>
<input type="submit" name="submit_me" value="go">
</form>
When user submits form, I need to get all 3 values - id, subject, and text. Furthermore, when user selects an option I need to auto populate <input type="text" name="template_subject"> field with some subject and populate <textarea name="template_text"></textarea> with very long text with html
Found many examples on this site how to populate input field with option text, and textarea with option value, but here's the problem: formatting dropdown as <select name="template_id"><option></option><option value="very long text with html">some subject</option></select> won't work, because template_id value would be missing, and writing very long text with html as option's value would be a very bad practice, I believe.
Looking at example,s I create a JSfiddle which seems to work partially, but once again, I don't think it's a good idea to write a long text (especially with HTML into option's value) - https://jsfiddle.net/ss050535/
How should I proceed? Using jquery, bootstrap and select2 if that matters.
I am working on an Angular 2 project, where I am using forms and validation and have come to the following problem. I have a page with 3 fields:
height
weight
BMI
I would like ALL 3 fields to be in my form so I have done the following:
<input name="height" type="text" class="form-control" formControlName="height">
<input name="weight" type="text" class="form-control" formControlName="weight">
<input name="bmi" type="text" class="form-control" formControlName="bmi">
So far this works fine. Although, I want BMI calculated automatically. I have a function detecting changes on the two fields (height and weight) and calculates the BMI and outputs it in the BMI input field. This works as intended as well.
HOWEVER, I would like to disable the BMI input field in order to prevent the user from being able to type anything. So I have the 3 following criteria:
The input field here meant to serve as a read only field for the user.
I also want the BMI to be part of formgroup which I send to my database when all 3 fields are valid.
(optional, but very much wanted) I want the BMI field to be an input field with the result from height and weight as I have implemented it, not as plain text.
I have tried putting a [disabled]=true tag on the BMI input field which doesn't work and gives me a warning that I should add the disabled tag in the formgroup. When I do this or use this command: this.myForm.controls['BMI'].disable(); it DOES disable it as intended, but also removes it from the formgroup. This means when I submit my formgroup only the value of height and weight is sent, bmi is left out.
How can I do this?
Any help is greatly appreciated!
Have you tried placing a readonly attribute on the input?
<input name="bmi" type="text" class="form-control" formControlName="bmi" readonly>
Are you using some kind of UI framework at all?
http://semantic-ui.com/collections/form.html#read-only-field
formGroup.getRawValue() will return even the disabled fields,
Source
I want to put a text next to an input box, after an successful if clause.
Just need to know how to show up such text.
Thanks
<input type="text" class="form-control" id="username" placeholder="Username" name="username" required autofocus/>
And my code snippet:
$("#username").append("<p>This username is not available</p>");
If your using jQuery, you can simply use:
$("#your-element-id").append("<strong>whatever text you need to add</strong>");
You will need to make sure that #your-element-id contains the input box. You may need to add the relavant CSS as well.