Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to add a new Check box "Activate Selected items" on the page ?  RSS feed

 
Jatin Guptaa
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am working on a web application for store file maintenance. Need to add a new Check Box "Activate Selected Menu items" on the page.
Can you please help what code i should write to add a Check Box.

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know HTML? You add a checkbox with the HTML input element of type checkbox.
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll have to be more specific than that. TellTheDetails. Add a checkbox when? Based on some user event or just static HTML? Show us some code and explain what you've tried.
 
Jatin Guptaa
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on Java Project with jsp.
Can you please help what code i should in .jsp file to write to add a Check Box. Details are :-

In “Manage Price: <price info name>” screen i.e. price info details page, new checkbox "Activate Selected Menu Items" will be added. Positioning of this new field would be on the right of “Activate Menu Items” checkbox at the bottom of the page.

This new field “Activate Selected Menu Items" would be a checkbox and is grayed out on the initial page on-load.

The "Activate Selected Menu Items" checkbox is only enabled after the user performs the "Search" operation or "Add New Menu Item" operation in the price set.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is all HTML and JavaScript -- doesn't sound like any JSP dynamic to it at all.

What part has you blocked?
 
Paul Ngom
Ranch Hand
Posts: 355
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Jatin,
you can visit http://www.w3schools.com/html/html_forms.asp to see how you can create your checkbox
and you can read the attributes of the input tag here http://www.w3schools.com/tags/tag_input.asp
You can manipulate these as you like.
It could also help if you post the generated html from your jsp mentioning where you want changes to occur.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Be aware the w3schools is not well-recommended by experienced web developers. I'd visit the link in the previous sentence for better recommendations, including MDN.
 
Jatin Guptaa
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Need to add a new Check Box at bottom of page.
User selects above listed items and select checkbox value = true to activate all selected items.
One checkbox is already added (Activate All Items) . need to add another as Activate Selected Items.
Can you please help how to add another CheckBox

 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adding new components using javascript/jquery is easy. You need to know where you are going to add them first and then the append function to add new html controls (in your case you will be adding input type="checkbox") elements. Give those new checkboxes a class as well. Selecting/deselecting then becomes easy. You just loop through the created elements setting checked=true e.g if you gave your input checkboxes a class called 'myClass' then the jquery code to select them would be


 
Paul Ngom
Ranch Hand
Posts: 355
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Need to add a new Check Box at bottom of page.
User selects above listed items and select checkbox value = true to activate all selected items.
One checkbox is already added (Activate All Items) . need to add another as Activate Selected Items.
Can you please help how to add another CheckBox

I am confused. If you have already created a checkbox(Activate All Items), why can't you use the same syntax to create another. In the jsp code you have posted, you have not shown where you have created the first checkbox.
 
Jatin Guptaa
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Added successfully.
Thanks all for your suggestions.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!