Hi all. I was wondering if there's a way to assign the value in a text field to a variable in jsp using Java (not Javascript). Normally in Javascript you might do something like: document.formName.fieldName.value
to access the value. How can this be achieved using Java? :icon_confused:
CodeBoy101
-2
Junior Poster in Training
Recommended Answers
Jump to PostIf you want to use java it must be done at the server. Meaning before you render the page.
For example.
Put a value at the requestrequest.setAttribute("key","The Value")
Then submit, redirect or whatever and at jsp, get it and put it at the field:String …
Jump to PostIf you have a value in a textfield and want to put it in a java variable, you need to submit the form (or pass it as parameter at a hyperlink)
If you want to put a java variable to a textfield, when you go to the page you …
All 6 Replies
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
CodeBoy101
-2
Junior Poster in Training
CodeBoy101
-2
Junior Poster in Training
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
CodeBoy101
-2
Junior Poster in Training
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.