algollefeks
New Member
I have a form with many buttons all of which print a value in the relevant textbox. the problem is the value is a fairly long text string and I would like to create a shorter variable eg. 'text' and make that variable equal to eg. 'some long sentence that I only want to type once'. any idea how I can edit this code to make this possible\[code\] function setInput(button, setValue) {var buttonVal = button.value, textbox = document.getElementById('input_' + buttonVal);textbox.value = http://stackoverflow.com/questions/12763577/setValue;<html> <input type='submit' name='submit_a' vhttp://stackoverflow.com/questions/12763577/alue="a" onclick="setInput(this,'make_me_a_variable'); return false;"> </html>\[/code\]