This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin 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
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

how to populate form fields with response from xmlhttprequest  RSS feed

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
i found a difficult to populate two tag html like(<select> and <input type="text") on getting response on the same time with response of xmlhttprequest from response of servlet java and integrate style css and event javascript? please suggest me a response
 
Ranch Hand
Posts: 213
2
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you have to parse the data, then build the Dom elements with JavaScript.  Probably easier to use jQuery for that.
 
Sheriff
Posts: 24091
54
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Parsing the data could be the hard part, so it would be best to make the format of the data returned from the servlet be as easy as possible to parse.
 
Marshal
Posts: 67226
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Populating form field values won't involve DOM manipulation, but everything in the browser is easier with jQuery.
 
Al Hobbs
Ranch Hand
Posts: 213
2
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Populating form field values won't involve DOM manipulation.


Why is it not considered Dom manipulation? Wouldn't she have to at least add something to existing html?
 
Bear Bibeault
Marshal
Posts: 67226
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Al Hobbs wrote:

Bear Bibeault wrote:Populating form field values won't involve DOM manipulation.


Why is it not considered Dom manipulation? Wouldn't she have to at least add something to existing html?


No. Setting the value of an existing form field makes no changes to the DOM, just to the attributes of existing DOM elements.

Now, if instead, she needed to create the form elements from scratch, then that would require DOM manipulations, but that doesn't sound like what she needs.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!