Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Enable/Disable input fields  RSS feed

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

        I'm trying to implement search functionality on my portfolio (huge system in the back-end). The back-end services are ready to use. However, I have limited experience with front-end design part. I'm using jsps with spring forms. My requirement is that, the search page have number of radio buttons corresponding with inputs (text field). User can select any one the search criteria and enter the value for it and the page returns the details using the back-end services. I want to initially disable all the inputs. When user selects particular radio button, then enable the corresponding input. If user chooses another radio button and comes back to the first one, clear the field.

Is this possible using javascript or jquery or any other framework?

Please note that, the search criteria may have at least 20 or 25 fields.
 
Saloon Keeper
Posts: 1691
68
Android Chrome IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm pretty sure that what you want achieve is possible using JavaScript/jQuery.

One way to tackle this project is to remove Spring from the requirement at the start and do this with only HTML and JavaScript and jQuery (which is JavaScript).
You can develop this locally with a small HTML file and a few form elements that you have in mind.
You do not need to get all the 20-25 fields in place, just maybe five or six.
You would not need to do this on any web server as you are only dealing with HTML and JavaScript which can run from you local system.
Once you have a working sample without Spring then bring your code into Spring and have Spring generate the HTML and JavaScript that you need/want.

There are a few ways of doing this which do depend on the page elements and functionality that you explicitly want.
 
When I was younger I felt like a man trapped inside a woman’s body. Then I was born. My twin is a tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!