Jump to content

Passing variables to a modal using clone


cve60069

Recommended Posts

hello

 

I am wanting to pass a number of variables to a modal using a cloned line. I write the variables into a string and then write to the modal using jquery. I attach a program showing my wants. if you refer to lines 65 and 66, I accessed two variables using 'name' and 'alt'. I created these variables on line 104. However, I want to pass more than just two variables and I would like to address the variables by their object.descriptor such as 'description, amount or duration'..

 

Is there a method to add these descriptors to the input statement, please? input.prototype.duration maybe.

 

variables.html

Link to comment
Share on other sites

I would put all variables into an object as properties, JSON-encode the object to a string, and store the object in an attribute like rel. In the handler function you can get the attribute and convert the JSON string back into an object.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...