wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes How to populate default textarea value on select from dropdown Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to populate default textarea value on select from dropdown" Watch "How to populate default textarea value on select from dropdown" New topic
Author

How to populate default textarea value on select from dropdown

Ramakanta Sahoo
Ranch Hand

Joined: Aug 23, 2008
Posts: 254

Hi All,

I am not able to get this silly question. I searched in google but didn't any satisfactory answers.
What i want is i have a default value in textarea which needs to get populated/replaced with a list of options from drop down.
Each dropdown has a big sql query named something. I want that query should get replaced with what ever is there by default in the text area.

Any examples will be great!!
Please help!!


Regards, Ricky
Oracle Weblogic 10g Certified Expert TechPaste.Com
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You either need t post the form back to the server or look into Ajax.

Eric
Joe Sondow
Ranch Hand

Joined: Apr 10, 2005
Posts: 195
Ramakanta,

I recommend that you post a very short HTML snippet showing the type of form you have in mind, along with any JavaScript attempt you have made so far, if possible. You're more likely to get a helpful response that way. See PostRealCode and NotACodeMill


SCJA 1.0 (98%), SCJP 1.4 (98%)
Ramakanta Sahoo
Ranch Hand

Joined: Aug 23, 2008
Posts: 254

Okay as you say here is code
I made it work by this but this has no advantage.
I am having problem in putting the queries which are big and multiline in savedquery.js how do i put very big multiline queries in array values.

savedquery.js




Joe Sondow
Ranch Hand

Joined: Apr 10, 2005
Posts: 195
Ramakanta,

You can add newline characters in your strings using \n like this:

Ramakanta Sahoo
Ranch Hand

Joined: Aug 23, 2008
Posts: 254

Yes I know but my problem is
How can I put if my query is like this :

Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
you DO NOT, let me repeat DO NOT want to store SQL Queries in your JavaScript. You are asking for your site to be hacked. That logic BELONGS on the server.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to populate default textarea value on select from dropdown