0

Here is the code that I have at the moment. I want the user to assign value to the variable NameCheck using the input text box, but I'm having trouble getting that to work.

        <p><strong>Name</strong></p>
        <input type="text" name="Name" size="100"/>

        <c:set var="NameCheck" value="${value.Name}"/>
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
dock_side_tough
  • 355
  • 2
  • 5
  • 11
  • If I understand your question right, you should use javascript as all the actions are happening on the client side. – AliBZ Aug 27 '13 at 23:53
  • In order to generate better answers/solutions, you'd better edit and improve/reformulate the question to state the concrete functional requirement. This question completely lacks the concrete functional requirement and you're basically just asking how to achieve a solution which is at its own not making much sense. You'd better elaborate about the actual problem for which you thought that *this* would be the right solution. It looks namely too much like that you completely missed the chapter "Servlets" in your learning path. Start here: http://stackoverflow.com/tags/servlets/info – BalusC Aug 28 '13 at 01:33

2 Answers2

0

When you POST the form to a servlet the servlet will see the value that has been filled into the input field.

If you are wanting to use the variable on the client, then you will need to use Jquery or Javascript to listen to the onchange event and then grab the value.

See How to implement onchange of <input type="text"> with jQuery?

Community
  • 1
  • 1
Scary Wombat
  • 44,617
  • 6
  • 35
  • 64
-1
    <p><strong>Name</strong></p>
    <input type="text" name="Name" size="100"/>

    <c:set var="NameCheck" value="${param.Name}"/>

All I had to do was change it to this.

dock_side_tough
  • 355
  • 2
  • 5
  • 11
  • As input tag are used for real time input, all that you achieve here is to store your incoming variable. If the user changes the input it will not be reflected in your 'NameCheck' variable. Maybe you need to change your question – Scary Wombat Aug 28 '13 at 06:09