What is wrong with my code. How do i pass attrfull to the inside. The way i have it done, if i run the function editsubmit($selected, size), $selected is inserted properly but i'm getting attrfull instead of size.
function editsubmit(attr, attrfull) {
if (attr.length) {
attr.val().length ? $selectedinput.attr({
attrfull: attr.val()
}) : $selectedinput.removeAttr(attrfull);
}
}
$selected is a variable and attrfull i a string. Do i need double qoutes around the string when i run the function like editsubmit($selected,'size').
attr(attrfull, attr.val()). Should work...attr.val()is the not the issue and i'm not using any php. This is a simple function. The only problem i'm having is attrfull is not being passed in to the attrfull that i have inside the function. So if i have editsubmit($var, 'size'), i'm expecting every reference to attrfull inside the function to be replaced with size. But this is not happening.