| Author |
How to populate default textarea value on select from dropdown
|
Ramakanta Sahoo
Ranch Hand
Joined: Aug 23, 2008
Posts: 228
|
|
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
TechBlog
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
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: 228
|
|
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: 228
|
|
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: 15357
|
|
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
|
 |
 |
|
|
subject: How to populate default textarea value on select from dropdown
|
|
|