Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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:


 
Marshal
Posts: 67424
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • 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
Marshal
Posts: 67424
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
It looks like it's time for me to write you a reality check! Or maybe a tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic