• 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

dynamic HTML

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey there folks,

a little question: I want my html form to be dynamic. For instance, the user chooses an entry from a dropdown box and according to what he chooses the rest of the site laying under the dropdown box changes immediatley. I can remember having seen that on the internet and its quite common. How can i achieve such site behaviour?

thanks for replies...
 
Ranch Hand
Posts: 174
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use frames..

http://www.w3schools.com/html/html_frames.asp
 
frank braunstein
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Chinna Eranna wrote:Use frames..

http://www.w3schools.com/html/html_frames.asp


I dont like frames! Isn't there another option? Something i could do with JSP's ?
 
Chinna Eranna
Ranch Hand
Posts: 174
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

frank braunstein wrote:
I dont like frames! Isn't there another option? Something i could do with JSP's ?



Any particular reason ?

You can also do it through JSP.

Say.. you have two values in select Box (1, 2) and two layouts to be displayed.. layout1 and layout2.

In the main jsp, you can have select box with these two values.. and include layout1.jsp and layout2.jsp depending on the value of the select box..

Whenever user changes the value in select box.. refresh the whole page.

 
frank braunstein
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Chinna Eranna wrote:

frank braunstein wrote:
I dont like frames! Isn't there another option? Something i could do with JSP's ?



Any particular reason ?

You can also do it through JSP.

Say.. you have two values in select Box (1, 2) and two layouts to be displayed.. layout1 and layout2.

In the main jsp, you can have select box with these two values.. and include layout1.jsp and layout2.jsp depending on the value of the select box..

Whenever user changes the value in select box.. refresh the whole page.



I was thinking too complicated. thank you very much...
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Frames? Are we back in the 90's, nope just checked my calendar.

You need to have an onchange event to look at the form field value or text



You can just show and hide the fields on the page. It is as simple as



Eric
 
Sheriff
Posts: 67749
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

Chinna Eranna wrote:Use frames


Frames? 1999 called and wants their site back!

Chinna Eranna wrote:Whenever user changes the value in select box.. refresh the whole page.


Another antiquated approach from days when browsers were much less capable.

In modern browsers, showing and hiding elements dynamically is easy. Even creating new elements on the fly has become commonplace with the help of JavaScript libraries.

There is no need to resort to out-dated methods like frames and full-page refreshes.
 
Blueberry pie is best when it is firm and you can hold in your hand. Smell it. And smell this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic