Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why Would An Unrelated Form/Submit Disable A Button?  RSS feed

 
Scott C macDonald
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so I've created a form with a hidden field and an image submit button that links to an an edit page. It's part of a table with multiple columns and rows. This button works perfectly, if I click any edit button for any row it will open that row up for editing. The bottom row of this table which is separated into 3 TD columns and a row, and should not be affected by this form and submit had an add button that adds another row. Previously this button worked when the link was set up using a combination of Spring URL and Spring Param tags and a href link, but now that the I'm using this (and have to), the add button is somehow disabled in that it can be clicked, but does not respond with any sort of functionality. I have spent yesterday afternoon going line by line trying to fix it. At one point I found that if I removed the button from it's column, and put it in the same column in a post form with the field it work work, but it sort of uglied it up, and now amount of CSS work could get everything in line for me. Any suggestions would be appreiated

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A few things: you probably want to repost your code with better indentation. As you can see above, the excessive unneeded indentation makes the post very wide and hard to read. Also some of the indentation is just wrong and makes it hard to inspect the structure.

Secondly, you should point out where in your code are the elements you are referring to. When you say "the button" tell us which one you are talking about.

Thirdly, if you do not know how to go about debugging in the browser, now is the time. Learn how to set breakpoints in your JavaScript code (most of which you have not shown us) so that you can tell if it is being called, and what's going on at the point of the break. You can learn about the debugger in Chrome (one of the better ones, in my opinion) here: https://developer.chrome.com/devtools
 
Scott C macDonald
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:A few things: you probably want to repost your code with better indentation. As you can see above, the excessive unneeded indentation makes the post very wide and hard to read. Also some of the indentation is just wrong and makes it hard to inspect the structure.

Secondly, you should point out where in your code are the elements you are referring to. When you say "the button" tell us which one you are talking about.

Thirdly, if you do not know how to go about debugging in the browser, now is the time. Learn how to set breakpoints in your JavaScript code (most of which you have not shown us) so that you can tell if it is being called, and what's going on at the point of the break. You can learn about the debugger in Chrome (one of the better ones, in my opinion) here: https://developer.chrome.com/devtools


The submit button on line 35 will not click, because of the addition of the form on line 3. I am working in Eclipse, and the browser in there does not let me set breakpoints for anything it seems beside the Java.
 
Scott C macDonald
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, the computer I'm working on is blocked from downloading any additional software. I couldn't even download Notepad++ to write a VBscript last month.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What browser are you using?

Client-side debugging happens in the browser, not in the IDE.
 
Scott C macDonald
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so what was causing this issue was outside the code I posted, and it was ridiculous, but it worked.

Above the code was the opening tag for the main form. For some reason because I created a secondary form to submit the link and the parameters, and it blocked off the URL to the add button at the bottom. What I ended up doing was closing off the form created at the top of the page after the for each loop after the first edit tag, and then created a second duplicate form and closed that. It passed the information, the button worked, the link worked the end. Happy Friday.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Client-side debugging occurs in the browser, not the IDE, but JSTL and scriptlet code is not client-side.

The only way that you can debug Java code that's defined (directly or via tags) on a JSP is to find the servlet that the JSP compiled into and put breakpoints in that servlet. And that's not easy, since the servlet code tends to not resemble the original JSP definition very closely.

Putting logic in JSP's isn't a bad idea just because it's old-fashioned. It's a bad idea because it's a to debug that

That's why you should put your logic in Java classes instead. Keep the JSP limited to simple constructs that don't need debugging.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:Client-side debugging occurs in the browser, not the IDE, but JSTL and scriptlet code is not client-side.

Very true, but I was referring to setting breakpoints in the submit handler.

Putting logic in JSP's isn't a bad idea just because it's old-fashioned. It's a bad idea because it's a to debug that
That's why you should put your logic in Java classes instead. Keep the JSP limited to simple constructs that don't need debugging.

Very very true.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!