ibo
asked on
JSP : textbox or textarea?
im using jsp.
i want to know what kind of form element im getting using
request.getParameter("para m"), it could be either text box or text area. how will i know?
i want to know what kind of form element im getting using
request.getParameter("para
If you have a from which uses GET when submit the form, the string will look like this:
A html tag can have these words inside:
TYPE
NAME
VALUE
You can name your textbox as TXTBX and the text area as TXTAR and getParameter("TXTBX") and getParameter("TXTAR") will return what you are looking for.
A html tag can have these words inside:
TYPE
NAME
VALUE
You can name your textbox as TXTBX and the text area as TXTAR and getParameter("TXTBX") and getParameter("TXTAR") will return what you are looking for.
Oh, I've made a little mistake in the previous answer. Anyway, few more details:
getServerNames() retrieve all the names you have and it hasn't any parameter, as mohan said.
getServerNames() retrieve all the names you have and it hasn't any parameter, as mohan said.
Hi,
I'm sorry. It should be request.getParamaterNames( ) rather.
bye
I'm sorry. It should be request.getParamaterNames(
bye
Your problem resumes to attrib a different name to text boxex/areas
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
sigh..
since im using the same name for textarea and text box (and using POST method since i have tons of form elements),
obviously the result of those getWhateverMethod() will be the same. anyway i just made a workaround by counting the string length hehe :)
since im using the same name for textarea and text box (and using POST method since i have tons of form elements),
obviously the result of those getWhateverMethod() will be the same. anyway i just made a workaround by counting the string length hehe :)
I do not agree with your choise regarding the answer. Anyway, if you'd said about using POST i'd have direct you to learn from here:
https://www.experts-exchange.com/jsp/qShow.jsp?ta=java&qid=20142195
https://www.experts-exchange.com/jsp/qShow.jsp?ta=java&qid=20142195
ASKER
what? where do u do not agree with?
Try using request.getParameterName("
bye