• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Show/Hide input fields with radio button on a JSP page

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have 3 radio buttons, for only one of them I must show a tel/email input fields,
I need to make visible the tel/email input fields after control of the informations entered.
after control (after click validate button), the error message (when I enter invalid informations) is displayed but the tel/email input fields is hidden (with the error message)
I need to show the tel/email input fields with the error message after click validate button, how can I do that ?
Than you for your help :)



JAVASCRIPT (nouveauDossier.js):






JSP Page:


 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your code is confusing. You are clearly using jQuery, yet your code has onclick attributes. You should never use the "on" attributes when using jQuery -- use jQuery to establish the event handlers.

You already showed that you know how to show and hide elements; so I'm not sure that I understand your question. Are you unsure how to capture the validation event?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, as this has nothing to do with JSP, it's been moved to the HTML/JavaScript forum.
 
Houssem Eddine
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can capture the validation event, but the problem is when I capture this validation event, that reinitialize the page and the input fiels are hidden, I need to keep the same page with the input fields showed !!
what can I use in the place of onclick ?
Thank you.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic