Retrieving the mouseEvent value in an insert statement

I am encountering a strange issue with my insert statement where I am receiving an unexpected value, ideally it should be a numeric value.

Below is the button code snippet found on my .pug page:

input(type="submit" value="Add Line" @click="addLine")

Here is my insert statement along with a post request:

  output Inserted.*
  Values (
    '${req.query.quote_number || ''}',
    ((select count(quote_number) as [count]
      from quote_line
      where quote_number = ${req.query.quote_number || ''}) + 1),
    'new item line',
    getDate()
  )

However, instead of the expected data for req.query.quote_number, I am receiving [object mouseEvent].

Answer №1

If you haven't already, have you experimented with connecting the input value using v-model? (v-model="somevariable") Connect the value to a variable first, then transmit the variable during the @click event

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Turn off the second dropdown menu if the first one has not been chosen

I need to implement a feature where the second dropdown is disabled if the first dropdown is not selected. Is there a way to achieve this using JavaScript? The requirement is that if the user does not select an option from the first dropdown, the second dr ...

Adjust the positioning of a class element

I have an eye icon that changes position when clicked. Initially, it is set to left: 10%;, but if there is a DOM element with the ID login-section, it should be repositioned to left: 50%;. I attempted to use document.getElementsByClassName('fa-eye-sl ...

Perform a check on the state of the slideToggle using an if-else function and provide a report on the slideToggle state

http://jsfiddle.net/vmKVS/ I need some help understanding the functionality of slideToggle using a small example. After toggling for the first time, the options element changes color to green. However, I expected the menu element to turn red when I togg ...

How can I adjust the width of a handle/thumb for NoUiSlider?

Looking to adjust the width of a NoUiSlider using CSS: .noUi-horizontal .noUi-handle { width:8px; height:25px; left: 0px; top: -8px; border: 0px solid #000000; border-radius: 0px; background: #000; cursor: default; box- ...

After a refresh of the single-page site, the header is not the first thing displayed

Upon refreshing the site, I encounter an issue where the header does not display first. Instead, it directly leads me to the contact section located further down the page. Has anyone else experienced this problem and found a solution? It's worth menti ...

Comparing the Firestore rules variable within the path to the data

Looking to compare a variable in the path with an entry in my document, I have created the following rule: match /{userId}/test/{cycle}/results { //allow read: if 3 == get(/databases/$(database)/documents/$(userId)/status).data.number allow read: if cy ...

Is it possible to refactor this forwardRef so that it can be easily reused in a function?

Currently, I am in the process of transitioning my application to Material UI V4 and facing challenges with moving my react router Link components into forwardRef wrapped components when setting the 'to' prop programmatically. The code below doe ...

Ensuring that the text in the Bootstrap navbar is responsive for all screen

Yesterday, I inquired about how to modify my navbar menu to switch from horizontal to vertically arranged depending on layout. However, I've noticed that the responsiveness is not consistent when adjusting the window size. Is there a way to ensure my ...

Is it possible to use JQuery ScrollTop while in the midst of an animation?

I am facing an issue with resizing containers and scrolling to elements. I have 2 containers that change width dynamically, each containing clickable elements. When a container is clicked, it animates the resize. However, when a clickable element is clicke ...

The JavaScript code is not being executed, as the address bar displays the function name instead

In my project, I have created numerous "js-classes" with various functions spread across different files. Unfortunately, the codebase is too large to share entirely. However, towards the end of the project, I encountered a bug where a specific function wa ...

Troubleshooting Safari compatibility issues with Twitter Direct Messages in Angular

I am attempting to create a Twitter direct message with predetermined text already filled in. My current method involves using window.open() to prepare the message. window.open(https://twitter.com/messages/compose?text=${this.helloWorld}); helloWorld = ...

The color of the three js cube is charcoal, definitely not a fiery red

Just dipping my toes into the world of three.js...my cube is displaying in black even though I set the color to red. Any ideas why? <!DOCTYPE html> <html> <head> <title>Experimenting with shapes</title> & ...

When is the best time to utilize v-layout within Vuetify 3?

I'm confused about the purpose and usage of the v-layout component in Vuetify 3. When looking at the documentation for the app-bar component, I noticed an example utilizing v-layout (GitHub code), but its impact is unclear: by removing the v-layout t ...

Running a repeated script

I recently discovered a fantastic script called Typer that creates a typewriter effect. However, I noticed that it does not have a built-in method to loop the animation once it reaches the end. Does anyone have any suggestions on how to achieve this? t ...

Send JSON data from a .json file to a Vue component via Express, then store it in a variable

How can I display data on my webpage that is stored in a dsa.json file? My setup involves using express with vue. Below is the code snippet from server.js: var data; fs.readFile('./dsa.json', 'utf8', (err, data) => { if (err) th ...

Gradually fade with JavaScript

My JavaScript code below is used to recursively reload a specific DIV with the results of a data query. The issue I'm facing is that each time the DIV, identified by id="outPut", is reloaded, all the data fades in and out due to the fadeTo function. ...

Watcher doesn't detect modifications in array values

I am working with a basic array structure that looks like this: dates[2] 0:"2018-01-09T15:00:00.000Z" 1:"2018-01-10T14:00:00.000Z" My watcher is configured as follows: data() { return { dates: [], } } watch: { // this fu ...

It appears that the jQuery $.get and $.post methods are not functioning as expected

Hey everyone, I'm facing an issue with two PHP session variables that I need to clear on click. I've attempted using both $.get and $.post AJAX methods to trigger an external PHP script that should reset the values of these session variables. How ...

Setting attributes on an AngularJS Directive element in real time

My goal is to create a directive in AngularJS with a template that can contain other AngularJS directives. All of my directives require an "id" attribute, so I must set the "id" on the directive within the template. However, no matter how I attempt this, A ...

Increase the number of file upload fields available for use

I've implemented this code to enable users to create additional upload fields. The fields are created successfully, and users can select a file. However, the selected file is not added to the input field except for the first one. On inspecting with fi ...