Accessing a variable and passing it along with <FORM> <HIDDEN>

I have a variable “sales” that I need to pass along using FORM <input type="hidden" name="FROM_DIV_CLASS_SALES" value=sales>

I can’t get it to work, how can variables such as “sales” below be accessed from an form field?

<div class="container">
<div class="right"><input type="text" id="sales" value="" name="sales" /></div></div>
<div class="container">

That depends on the method of your form, get or post.

I’m using “post”.

A method that you can use is with JQuery. You get the value of the input element with the following code:

$(document).ready(function(){
var variableInput=$('#sales').val();
});

Then you can use the variableInput via Javascript wherever you want.
eg

What is the purpose of the form?
What do you intend doing with the data?
Are you using back-end processing?

For example in PHP you would get the data from the $_POST array, then do as you like with it.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.