M
madmikeproductions
How do I pass a local variable from one function to another function?
Is there a way to send that data to a global variable and re-use it?
Here is what I am trying to do:
I have a color picker form that has radio buttons that tell the form
which text field to write to.
When you select the radio button, it should put the value of that
radio button in a variable so that the function of the color picker
can write the color code to the textbox that is selected.
Here is the basis of the code:
function elem_check() {
for (i=0; i<document.pickerform.chooser.length; i++) {
if (document.pickerform.chooser.checked==true) {
tSelect = document.pickerform.chooser.value
}
}
//I either then need to pass tSelect to the other function or
write this string to it ("$('"+tSelect+"').value='#'+v;");
}
Anytime I've tried doing this globally without the function, it
doesn't work and anytime I try to call tSelect to the other function,
it only works on the first textbox.
Thanks for any help.
Michael M. Kadrie
Atlas Design Group
imagine it Real
Is there a way to send that data to a global variable and re-use it?
Here is what I am trying to do:
I have a color picker form that has radio buttons that tell the form
which text field to write to.
When you select the radio button, it should put the value of that
radio button in a variable so that the function of the color picker
can write the color code to the textbox that is selected.
Here is the basis of the code:
function elem_check() {
for (i=0; i<document.pickerform.chooser.length; i++) {
if (document.pickerform.chooser.checked==true) {
tSelect = document.pickerform.chooser.value
}
}
//I either then need to pass tSelect to the other function or
write this string to it ("$('"+tSelect+"').value='#'+v;");
}
Anytime I've tried doing this globally without the function, it
doesn't work and anytime I try to call tSelect to the other function,
it only works on the first textbox.
Thanks for any help.
Michael M. Kadrie
Atlas Design Group
imagine it Real