How to get value of an element by ID in JSP.

Started on the old forum in February 2011 · view the original in the archive · old links redirect here

2 replies · 5,888 views · started 15 years ago · 1 min read

3 participants
smarty3010 Newbie · 3 posts #1

How can i get value of an element by ID in JSP.

Example: <input id="Text1" type="text" /> the following works while using ID In javascript -> document.getElementById("Text1").value; In JSP -> DONT KNOW

If we are using name instead of ID <input type='text' name='name'> then the following works in javascript -> document.formname.name.value; in JSP -> request.getParameter("name");

frostymarvelous Senior · 266 posts #2

Jsp? Doubt many people know that. Java server pages aint a language of choice.

Perfection comes at a cost

I accept liberty!

tkreturns Developer · 98 posts #3

dont really have an idea but y dont you try

<input id="Text1" type="text" name="name"/>

lol

ASK FOR HELP

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close