I have been working with jQuery for some time now, & while I was working on Ajax GET, iPOST methods, I am not able to understand exactly, what is content-type and datatype in a POST request, in this example request
...I need to fetch element using "data-id
" attribute of HTML, using jquery, here is the element
I am using jQuery validation plugin in my form, but I am not able to show validation errors on button click using the above plugin, in my form.
Here is my code
...I am using jQuery Validate to validate my form, it is placing errors in a position which is not appropriate for my forms, I want to change the position of error placement in it, but not to find a solution.
My jQuery code:
$('#content form:first').validate({
rules: {
MSRP: {
number: true
},
SellingPrice: {
number: true
},
BoxDimensionHeight: {
number: true
},
BoxDimensionWidth: {
number: true
},
BoxDimensionDepth: {
number: true
},
BoxWeight: {
number: true
}
},
ignore: ':not(select:hidden, input:visible, textarea:visible)',
});
HTML Code:
<div class="row ">
<label class="control-label col-md-2 col-sm-12 col-xs-12">
Name<span class="required">*</span>
</label>
<div class="col-md-10 col-xs-12 col-sm-12" style="padding:0">
<div class="fg-line">
<input class="form-control" id="Name" name="Name" required="" type="text" />
</div>
</div>
</div>
the output of code:
...
I have seen many methods like window.location.href=url
, window.location.replace(...)
and window.location
, but can anyone tell me which is the best method to redirect user from one webpage to another using jQuery or javascript?
thank you
I am trying to stick the ads on website while user scroll it, using the code below
...I have a web application and i want a textbox in which user cannot type any thing expcet numeric(0-9) data.
How can we achieve this using jquery?
thanks
...I want to scroll to a div on button using jquery, which is working, but as a i was expecting, what i need here to scroll to div smothly(with animation), but it is jumping to a div directly(no animation or smotth scroll) on button click, my jquery code is
...As i know and understand that for dynamically created element, we need to write jquery function like
...