Why is onblur="trim()" used in input element? [closed] - html

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
<input type="text" name="firstName" id="firstName" onblur="trim(document.TheForm.firstName)" value="" />
In the above element the why is attribute onblur="trim(document.TheForm.firstName)" used.

To remove trailing whitespace when you leave the field.

When a user leaves the input field firstName, the entered value is trimmed.

Related

how can I prevent a user to type 0 as the first character in a text input using vanilla javascript? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have this html block:
<div class="form-group flex-auto" >
<input maxlength="2" class="form-control format__itemForm" type="text" ng-model="$ctrl.codigoPaisTelefono" prevent-keys="{{ $ctrl.caracteresExcluidos }}"
required oninput="this.value== 0? this.value == '' :void(0)"
>
</div>
I need to prevent users to type 0 as the first character, I tried oninput method above, but didn't work.
Any clue?
Something like this maybe?
function validate(element){
var val = element.value;
if(val.charAt(0)=='0'){
element.value=val.substring(1, val.length);
}
}
<input oninput="validate(this)">

How insert product multiple image by laravel? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
here is my html code form code.
<div class="form-group">
<label >Product Image</label>
<input type="file" class="form-control btn btn-primary" name="image[]" multiple="multiple">
</div>
you can use like this in your laravel controller file
in controller
$productSubImages = $request->file('sub_image');
foreach($productSubImages as $productSubImage){
$subImageName =$productSubImage->getClientOriginalName();
$subImageDirectory = 'product-sub-images/';
$productSubImage->move($subImageDirectory,$subImageName);
$subImageUrl =$subImageDirectory.$subImageName;
$subImage = new SubImage();
$subImage->product_id = $productId;
$subImage->sub_image = $subImageUrl;
$subImage->save();
}

how to make input field required which is in Bootstrap Modal? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
Before submitting the form user would know that model fields all mandatory that he/she as to fill out first before submitting the form.
If you want to make required fields on a form, all you have to do is add required="required" in the <input> tags.
Doing this kind of custom message can only be done in the <input> tag, using the oninvalid attribute. Do this:
<input type="text" oninvalid="alert('Hey, you missed something on modal!')" required="required">

What function does a submit button call? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to create my custom submit button. So I need to know what javascript function does the input type submit button call? I don't want a css customized submit button if possible.
In Case your HTML Looks like this:
<form id="myform" name="myform" action="destination.html">
<input id="sub_Button" type="button" value="clickme" onclick="mySubmitFunction();" />
</form>
Do you mean JavaScript?
document.myform.submit();
Or JQuery?
$("#myform").submit();

How i draw 3textbox in in <td> [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
![example of textbox i want![][1]][1]
EXAPMLE OF textbox
hi to all
i have some problem with Table
when i create tage
i want like example below.
i have some problem
1. when i enter
CNIC-NO
--
they cannot dispplay same line
Note. i have only 2 coloumns in my table.
plz tell me how i draw this text box like example attached below.
[1]: http://i.stack.imgur.com/ulpZm.png "table
"
you can simply do this
<td>
<input type="text" style="display: inline-block" />
<input type="text" style="display: inline-block" />
<input type="text" style="display: inline-block" />
</td>