JustinK101
Programmer
Hello All,
I need to do something a little funky:
I have a form element multiple select:
<select name="vehicles[]" id="vehicles" size="' . $size . '" multiple onChange="updateServiceInstructions();">
I also have a form element textarea:
<textarea name="vehicle_instructions" cols="108" rows="6" dir="ltr" lang="en">
I need to figure out some JS code when ever a row is selected in vehicles[] it needs to get the value/text of that entire row and put it in the vehicles_instructions textarea and then append three newlines. Then if the user selects another vehicle the same action occurs with that row put into the textarea with three newlines.
Then if a row is deselected it would be nice, but not required if impossible, to delete the row in the textarea and clean up the newlines.
I have started by setting the event handler in the select but other than that I have no idea.
function updateServiceInstructions()
{
}
Thanks for any help.
- Justin
I need to do something a little funky:
I have a form element multiple select:
<select name="vehicles[]" id="vehicles" size="' . $size . '" multiple onChange="updateServiceInstructions();">
I also have a form element textarea:
<textarea name="vehicle_instructions" cols="108" rows="6" dir="ltr" lang="en">
I need to figure out some JS code when ever a row is selected in vehicles[] it needs to get the value/text of that entire row and put it in the vehicles_instructions textarea and then append three newlines. Then if the user selects another vehicle the same action occurs with that row put into the textarea with three newlines.
Then if a row is deselected it would be nice, but not required if impossible, to delete the row in the textarea and clean up the newlines.
I have started by setting the event handler in the select but other than that I have no idea.
function updateServiceInstructions()
{
}
Thanks for any help.
- Justin