Questions tagged [unobtrusive]

46 questions
17
votes
9 answers

ASP.NET MVC - How to prevent double click submit with jquery.validate.unobtrusive lib?

I need to avoid the double click submitting behavior. I'm using the client validation with the unobtrusive library. I have the following code for avoiding the double clic: jQuery.fn.preventDoubleSubmit = function () { var alreadySubmitted =…
Rodrigo Caballero
  • 1,090
  • 1
  • 15
  • 27
7
votes
2 answers

jQuery.validator.unobtrusive.adapters.addMinMax round trips, doesn't work in MVC3

I am creating a day range validator using DataAnnotations, jQuery.validate and jquery.validate.unobtrusive. I've already read the…
jolySoft
  • 2,948
  • 2
  • 30
  • 34
6
votes
5 answers

How to prevent jQuery onload flicker unobtrusively?

I'm using jQuery UI Tabs. How should I prevent the flicker of loading content while also making sure that the content is visible when javascript is disabled? I've tried adding a .js class to the body when the doc is loaded but as the tabs are loaded…
Asa Carter
  • 2,207
  • 5
  • 32
  • 62
4
votes
1 answer

CakePHP and jQuery - Unobtrusive actions

I'm trying to make an unobtrusive action for deleting bookmarks in CakePHP. Allthough it's working just fine, I suspect there must be a better way to do this. Could someone please point me in the right direction? function delete($id = null) { $ok…
fortysixandtwo
  • 485
  • 5
  • 12
3
votes
4 answers

Creating a record for an association unobtrusively when attempting access?

I have a simple has_one/belongs_to relationship between two models. This is a new association in my application so there are many records that do not yet have the associated record created. Throughout my application I'm assuming the model has the…
mwilliams
  • 9,946
  • 13
  • 50
  • 71
3
votes
2 answers

How to unobtrusively add new Validation methods to Magento checkout?

I want to prevent customers entering PO Boxes into the shipping address for selected Shipping Methods (UPS specifically in this case). I could override js/prototype/validation.js to insert a new validation pattern, but I don't want to fork such a…
Jonathan Day
  • 18,519
  • 10
  • 84
  • 137
2
votes
1 answer

jQuery Button Handler vs inline onClick

Here's the problem: I have a list of items on a page, each with its own link/button to delete it. Currently, I have an onclick on each button because each button needs to pass the id and a description/name of the item to a JS function. I would like…
Moismyname
  • 472
  • 1
  • 6
  • 17
2
votes
2 answers

Need help on making my Javascript unobtrusive

So I have created an order form in HTML + Javascript, and what I am wanting to use Javascript for is when someone hovers over the "label" for the soup, a hidden div will be visible (later on I intend on getting the code that will display info about…
Rob
  • 1,272
  • 6
  • 24
  • 35
2
votes
4 answers

Javascript inside AJAX request

I have a little problem with an AJAX function: PAGE A stands for the page. PAGE X stands for the loaded content. RES A stands for the page results. RES B stands for some AJAX loaded content => new results. PAGE A contains 20 results, each result…
kfa
  • 2,106
  • 4
  • 17
  • 22
2
votes
2 answers

No data-val* attributes with Partial Views

I have a view with Html.BeginForm() that calls a partial view(mentioned below and has no Form) passing in the main viewmodel. The Model has Data Annotation. On initial load of the page validation works perfectly if I try to submit without selecting…
sagar
  • 359
  • 5
  • 11
2
votes
2 answers

Context is Missing when using Unobtrusive ajax in asp.net mvc-3

i have just shifted to unobtrusive ajax that ships with mvc-3 but it is breaking at one point. Here is my link <%:Ajax.ActionLink("Edit", "Home", "Edit", new{id = Model.SomeID}, new AjaxOptions{OnSuccess = "DoSomething"})%> this is my js function…
2
votes
0 answers

Unobtrusively add block in cart

For a module I'm working on, I want to add a block in the shopping cart screen, I want to do it unobtrusively and I'd like to place it beneath the cart content and before the other blocks (coupon, shipping estimation, totals, ...). I've managed to…
OSdave
  • 8,538
  • 7
  • 45
  • 60
2
votes
1 answer

NServiceBus Unobtrusive Conventions DefiningCommandsAs multiple times

It seems that I cannot define commands/events conventions more than once. Every registered convention will override previous. This works: configuration.Conventions() .DefiningCommandsAs( type => type.FullName ==…
Sergej Popov
  • 2,933
  • 6
  • 36
  • 53
2
votes
1 answer

Reactjs + ASP MVC Unobtrusive Validation

I have next code componentDidMount() { super.componentDidMount(); let jobj = $(ReactDOM.findDOMNode(this)); $.validator.unobtrusive.parse(jobj); } after run this, i get error: Uncaught TypeError: Cannot read property 'unobtrusive' of…
kirsanv43
  • 358
  • 2
  • 13
2
votes
0 answers

$.validator is undefined in partial view ASP.NET MVC - Suggestions Needed

The application i am working is a single page application using asp.net MVC 4, so i am using ajax for loading the partial views. jquery.validate.js and jquery.validate.unobtrusive.js has been added in _layout.cshtml using bundling. These were not…
salkav1804
  • 41
  • 3
1
2 3 4