Input field (type number) redirects to file upload when user pressing enter into input field - forms

enter image description here
This is my code for input field. When I press enter into the input field it redirects to upload file from computer view.
Like that page
enter image description here
This is my code for input field under a form
<div fxFlex="20%" class="input-size" fxLayoutAlign="end center">
<mat-form-field class="w-100-p" appearance="outline">
<input type="number" min="0" matInput formControlName="AnzahlPaletten">
</mat-form-field>
</div>
I don't want to redirect to upload file view.

Related

Razor Pages Password Input Box Keeps Displaying Default Dots

Built Add and Edit pages in .NET Core 3.1 Razor pages. When Edit page displays, both the "Password" and "Confirm Password" input boxes render empty as they should. When the Add pages displays, the "Confirm Password" input renders empty but the "Password" input renders with 15 default dots already entered. The input box code seems exactly the same on both pages:
<div class="form-group">
<label asp-for="User.user_password"></label>
<input type="password" class="form-control" asp-for="User.user_password" />
<span asp-validation-for="User.user_password"></span>
</div>
<div class="form-group">
<label asp-for="User.confirm_password"></label>
<input type="password" class="form-control" asp-for="User.confirm_password" />
<span asp-validation-for="User.confirm_password"></span>
</div>
Tried adding value="" but it still rendered the default dots. I'm not populating the inputs on the backend with anything. Any ideas?
Update on my comment.
If problem is in browser autofill, you could try to clear autofill for that domain.
How to clear saved auto fill passwords in chrome
add autocomplete="off" to html
<input type="password" class="form-control" asp-for="User.confirm_password" autocomplete="off" />

Emoji's not getting sent from text input in ionic

I am trying to send emoji's from input box once I click enter it's not getting sent in form of emojis it's getting converted into "??".
<ion-input autocomplete="true" spellcheck="true" class='input-cover' type="text" [(ngModel)]="userComment" placeholder="Post a Comment">
</ion-input>

Submit on enter with 2 text inputs

I have two text inputs and each has a submit button. Each button has an on click AJAX function that calls a php script and populates the page.
I need to find a way to make the enter key submit the button of the input text focused.
For example if I type something the in the "product_code" input text and press the Enter key I want to call the AJAX function of that input's assigned button (getByCode()).
Product name: <input type="text" name="product_name" id="product_name">
<input type="submit" value="Search" onClick="searchByName(document.getElementById('product_name').value)"> <br />
Product code: <input type="text" name="product_code" id="product_code">
<input type="submit" value="Search" onClick="getByCode(document.getElementById('product_code').value)"> <br />
I don't necessarily require input buttons, I could use images for example if that helps.
All browsers support document.activeElement which will tell you which element has focus. On your keypress event handler, check this value against your two inputs to see which has focus. If neither has focus, then ... ?

Strange IE form file select bug

I am making a simple image uploader. Since normal file selected cannot be styled do i use a bit of javascript to overcome this. There's just one problem, when someone using IE trys to upload a file by pressing the "fake" file select bar and press submit the selected image disappear. Do anyone know why this happens?
Try it for yourself
File score (same as in link above):
<form action="fileUploadBugIE.php" method="POST" enctype="multipart/form-data" character_set="UTF_8" >
<input type="text" readonly="readonly" id="filePath" onclick="document.getElementById('fileUL').click();" /><br /><br />
<input type="file" name="imageFile" id="fileUL" onchange="document.getElementById('filePath').value = this.value;"/><br />
<input type="submit" value="Submit" />
</form>

Why does enter submit a form differently than clicking submit in IE 7?

In IE 7 the zip code search form on my page reacts differently when someone clicks submit vs pressing enter. It works correctly when sumbmit is clicked and incorrectly when enter is pressed.
http://getridofit.com
<form name="zip" action="<?php bloginfo('url'); ?>" method="get">
<input type="text" id="zipper" name="locations" size="5" maxlength="5" class="junk-input" onsubmit="return checkForm()" />
<input type="submit" value="" name="schedule" src="/wp-content/uploads/remove-my-junk.png" align="center" class="junk-button" style="background: #f67a3e url(/wp-content/uploads/remove-my-junk.png); border: none; width: 201px; height: 45px;"/>
</form>
The correct result for a zip search of 85718 looks like this: http://getridofit.com/l/85718/?schedule
but pressing enter produces a result like this: http://getridofit.com/l/85718/
Because the button wasnt clicked in order to submit the form. If you dont click the button then the input for #name[schedule] isnt sent. However if that button input has focus when enter is pressed i think it will send it along properly... You might jsut want to make schedule a hidden input.
It looks like you are checking for the presence of the submit button variable (schedule) in the URL bar. The submit button variable is only supposed to be submitted when the user physically clicks the the submit button. However, I can't reproduce the problem in Safari, so it may also depend on what your JavaScript is doing when the form is submitted.