TextField - show hint before user starts typing text
Date : March 29 2020, 07:55 AM
With these it helps I am developing an Blackberry application. I want to show a hint text in TextField before user starts typing.when user starts typing it should disappear and when there are 0 characters in TextField it should show up.Has anybody implemented this yet?then please share. , here is the implementation within paint() method String test = super.getText();
if ( test == null || test.length() < 1 ) {
graphics.setColor( 0x00a0a0a0 );
graphics.drawText(hint, 0, 0);
}
|
How to show Search charm when user starts typing in windows 8 app (html & js)
Date : March 29 2020, 07:55 AM
wish of those help Building a Win8 app using JS and Html. How can I have the Search charm appear as soon as the user starts typing when my app is open? I have the following code in default.js, just before app.addEventListener("activated", function (args) {: , This retrieves the setting value: var showOnKeyboardInput = searchPane.showOnKeyboardInput;
searchPane.showOnKeyboardInput = showOnKeyboardInput;
searchPane.showOnKeyboardInput = true;
|
Show element if user starts typing
Date : March 29 2020, 07:55 AM
wish of those help I am trying to show an element when the following criteria has been met: 1. The input is in focus 2. The input has 1 or more characters. , You can use input event instead of click event and focus selector: $('input').on('input', function(){
if ($(this).val().length > 1) {
$(this).siblings('.show').fadeIn();
} else {
$(this).siblings('.show').fadeOut();
}
});
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: sans-serif;
font-size: 16px;
color: #5c5c5c;
line-height: 22px;
}
main {
max-width: 600px;
margin: 20px auto;
padding: 16px;
}
.group {
margin-bottom: 16px;
position: relative;
}
label {
color: #393939;
display: block;
margin-bottom: 8px;
font-weight: bold;
}
input,
textarea {
font-family: sans-serif;
font-size: 16px;
color: #5c5c5c;
border-radius: 2px;
border: 1px solid #ccc;
width: 100%;
padding: 12px;
margin-bottom: 4px;
-webkit-appearance: none;
outline: none;
transition: all 0.4s ease;
}
input:not(textarea){
height: 48px;
}
input:focus,
textarea:focus {
box-shadow: inset 0 0 0 2px rgba(74, 168, 81, 1);
}
::placeholder {
font-family: sans-serif;
color: #bbb;
}
.hint {
font-size: 14px;
line-height: 20px;
color: #727272;
position: relative;
top: -5px;
opacity: 0;
z-index: -1;
transition: all 0.2s ease;
}
input:focus + .hint {
opacity: 1;
top: 0;
}
.show {
font-size: 14px;
line-height: 20px;
display: none;
position: absolute;
top: 44px;
right: 14px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<main>
<div class="group">
<label for="email">Email</label>
<input type="text" id="email" placeholder="e.g. jamesgreen@gmail.com">
</div>
<div class="group">
<label for="password">Password</label>
<input type="password" id="password">
<p class="hint">Password must have at least 8 characters, a lower case letter, an uppercase letter and a number</p>
<span class="show">SHOW</span>
</div>
</main>
|
Hide datalist options when user starts typing
Date : March 29 2020, 07:55 AM
I hope this helps you . One way you can do this is to chage the datalist id when there is a value in input. If there is no value then change the id back so that they can choose the options in the datalist rather than type a new one. function hideList(input) {
var datalist = document.querySelector("datalist");
if (input.value) {
datalist.id = "";
} else {
datalist.id = "talk-list";
}
}
<input id ="userText" name="userText" type="text" list = 'talk-list' oninput="hideList(this)"></input>
<span class = "dropdown" title = "Saved Talk"><datalist id = 'talk-list'><option>Apple</option><option>Ball</option><option>Calculator</option><option>Donkey</option></datalist></span>
<button id="speakText" class="toolbutton" title="Speak">Speak</button>
|
Is there a way to hide a UILabel when the user starts typing, and then make it re-appear if the user removes all input?
Tag : ios , By : Paul Schwarz
Date : March 29 2020, 07:55 AM
it fixes the issue You Can do it using add a target to your textFiled with a selector like this add this target to ur viewDidLoad method yourTextFiled.addTarget(self, action: #selector(self.textFieldDidChange(_:)), for: UIControl.Event.editingChanged)
@objc func textFieldDidChange(_ textField: UITextField) {
if textField.text!.isEmpty {
label.isHidden = false
} else {
label.isHidden = true
}
}
|