September 24th, 2012, 05:48 AM
I have TEXTAREA form, i want to add DROP DOWN LIST BOX beside it,like prefix in forum
i have comment form code (in black colour) below, user type the comment in TEXTAREA, and click the Submit button
i want to add DROP DOWN LIST BOX before it, that user can choose, and add that DROP DOWN value with the text in TEXTAREA into database, so just like prefix in forum
i already tried below code (in red), but still not working, please help guys what is the right code
September 24th, 2012, 11:24 AM
The following makes no sense at all.
Have a look at this, provided with an excess of variables to show you the way.
value = "["+msgPrefix+"] "+value;
var msgForm = document.forms['comment_form'];
var msgPrefix = msgForm.elements['message_prefix'];
var msgPrefixVal = msgPrefix.options[msgPrefix.selectedIndex].value;
var msg = msgForm.elements['message'];
var msgVal = msg.value;
msg.value = '[' + msgPrefixVal + '] ' + msgVal;