Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [unobtrusive-javascript]

Unobtrusive JavaScript is a general approach to the use of JavaScript in web pages.

unobtrusive-javascript
0 votes
0 answers
144 views

Issue with Ajax Unobtrusive form submitting twice sometimes in .net core razor

Sometimes form submit multiple times in razor page. I am using version 3.2.6 of unobrustive ajax. I double checked the viewpagesource to make sure only one unobrustive ajax library is there. There ...
Nayas Subramanian's user avatar
1 vote
1 answer
1k views

Custom Validation for nested model in .net core

I am trying to validate a nested model using custom validation. But the problem is AttributeAdapterBase.AddValidation function is never called on nested model. However it works well with simple class ...
Safi Mustafa's user avatar
-1 votes
1 answer
160 views

Migrate non function script from HTML to JS file

As a begineer i am facing a problem, i followed an advise from several opinions to keep my HTML file clean, so i created a JS file and started migrating all scripts to a it, everything is Ok until i ...
Stalkium's user avatar
  • 148
0 votes
0 answers
148 views

How to get actual element clicked on instead of Rails unobtrusive javascript form?

I have a small React 16 menu panel that is running in a Rails 6 application. When the panel is open, I want to close it and stop propagation, if the user clicks outside the panel. (I don't want an ...
antun's user avatar
  • 2,227
0 votes
0 answers
187 views

dynamic form ajax beginform validation error - MVC

Implementation Detail: Page has Add Button and Table view On Add button click, partial view (form) is loaded on Modal PopUp. Dynamic form selected based on parameter. On Add button click below code ...
Sridhar's user avatar
  • 503
0 votes
1 answer
2k views

Issue when trying to render a js.erb partial template

Rails version 6.0.2.1 Ruby version 2.6.5 I am trying to render a partial in a show view of my application using jquery. This is my javascript file: import $ from "jquery"; $(() => $("a#test-...
Sandro Palmieri's user avatar
0 votes
1 answer
618 views

Reinitialize unobstrusive jquery validation

I've rebinding viewmodel via ajax because of I don't like the default feature modal popup, since I forgot which tutorial link I'm following, here's some of my code The datatable code $(document)....
This lowly newb's user avatar
0 votes
1 answer
538 views

How to make an Unobtrusive Ajax call within a Select List?

I am attempting to set up a drop down in my App that allows users to select a list of metadata depending upon whether or not it is classified as PII. The problem I am running into is how to ...
C Murphy's user avatar
0 votes
1 answer
58 views

Div Print using unobtrusive javascript

I have a Print link where I want to print a printer friendly section of a View page. I don't want to print the menus but just a certain div id using unobtrusive javascript. How do I do that? Printer-...
bootsy's user avatar
  • 87
0 votes
1 answer
1k views

rails 5 remote: true returns javascript within html template

So I have a delete link on one of my views, and I need to use UJS to run the destroy method on the corresponding controller, and then return a destroy.js.erb template. However, when I click the ...
greyoxide's user avatar
  • 1,267
2 votes
1 answer
656 views

Visual Studio Mac appsettings.json allow unobtrusive javascript

@Ajax is not being recognized in razor views for my MVC application. I believe the reason is bc Unobtrusive Javascript isn't allowed for the newest version of VS Mac? To fix this problem "the web" ...
webbyweb's user avatar
  • 425
0 votes
1 answer
1k views

Rails 5 - use collection_radio_buttons to open a partial with nested models?

(my first SO question, so please be kind!) Each Schedule has only one System; Each System has many Applications; Each Application has many Users and Documents. What I want to do to create a Schedule ...
Leland's user avatar
  • 5
0 votes
1 answer
399 views

Remote validation causes submit inputs (multiple-submit-buttons) to be null

I recently implemented remote validation in my form: ViewModel: [Remote("IsTagUnique", "myController", "myArea", ErrorMessage = "This tag already exists.")] public string tag { get; set; } ...
AbcUser123's user avatar
0 votes
2 answers
2k views

Javascript is not executed

i cant figure out, why my javascript is not executed (and its really not executed). /app/assets/javascripts/application.js: //= require jquery //= require bootstrap-sprockets //= require turbolinks /...
Jens Schmidt's user avatar
3 votes
0 answers
856 views

How to add attribute data-val-required if it is removed dynamically using jquery

I want to remove attribute on some condition so i used this $("#tab-1").removeAttr("data-val-required"); But now on some conditions i want to make it required again i have used this but it doesnt ...
Mussaib Siddiqui's user avatar

15 30 50 per page
1
2 3 4 5
35