473,508 Members | 2,367 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing hidden form elements using Java Script....

2 New Member
Hi all,
I want to pass the value of the select box to another form using java script. my code looks like this..
<script>
function func
{
document.myform.action = "abc.cgi";
document.myform.submit();
}

<select name="xyz" onchange=func()>
<option value = "abc">1</option>
<<option value = "def">2</option>
</select>

I want to pass abc to next form (abc.cgi) when 1 is selected from the select box.
Please help me
Jun 29 '07 #1
7 2125
kamalaswaminathan
2 New Member
Hi all,
I want to pass the value of the select box to another form using java script. my code looks like this..
<script>
function func
{
doucment.formname.action = "adc.cgi";
document.formname.submit();
}
<select name="xyz" onchange=func()>
<option value = "abc">1</option>
<<option value = "def">2</option>
</select>
I want to pass the value abc when 1 is selected to another form....

Please help me.....
Jun 29 '07 #2
acoder
16,027 Recognized Expert Moderator MVP
func should have parentheses:
Expand|Select|Wrap|Line Numbers
  1. function func()
Jun 30 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
Threads merged.
Jun 30 '07 #4
kovik
1,044 Recognized Expert Top Contributor
And you may wanna clean up the dozens of syntax errors as well. :-p
Jul 1 '07 #5
gits
5,390 Recognized Expert Moderator Expert
And you may wanna clean up the dozens of syntax errors as well. :-p
as far as i can see there are 'only' two more (besides the missing func-brackets) ;)

Expand|Select|Wrap|Line Numbers
  1. // put function call in quotes
  2. <select name="xyz" onchange="func();">
  3.  
  4. // fix opening tag
  5. <option value = "def">2</option>
  6.  
kind regards ...
Jul 1 '07 #6
kovik
1,044 Recognized Expert Top Contributor
as far as i can see there are 'only' two more (besides the missing func-brackets) ;)
And the missing <script> tag.
Jul 1 '07 #7
gits
5,390 Recognized Expert Moderator Expert
;) i supposed this to be due to the snippet-pasting ... and assumed that it is not missing in the real app ...

kind regards ...
Jul 1 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3517
by: Xerxes | last post by:
Hi, how can I pass the returned value from Javascript to PHP? I have: ------------------------------------------------------------------------ ------ if ( x>y) {
3
3622
by: Jason | last post by:
Hi folks, I'm trying to create a section of a website with a unique file upload utility. The problem is that in most code and components I find to pass multipart/form data, you need to know the...
12
6508
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
9
2146
by: Max | last post by:
I'm new with Javascript and can't seem to figure out what I'm doing wrong here as I'm not able to pass a simple variable to a function. In the head of doc I have: <script...
8
3654
by: Mike Fellows | last post by:
Ok, im not sure if this is at all possible and if it is how i go about it is beyond me i have a piece of client side code that requires a piece of data from the server side (an ID number in this...
1
2259
by: williamroy | last post by:
Hello, I've got a form that runs over 5 pages. I need the last page submit button to post all of the answers at one time from the previous 5 pages (to another server). I'd like to see the last...
1
1716
by: Marty Meyers | last post by:
TIA for your help! I have a page (code snip below) named "browse" which has a table in it with rows like this: 2003 1500 Silverado pickup red 51,024 $19,995 Details --------- each row...
2
2183
by: Bill Steele | last post by:
I want to have a window pop up with a form. When the form is submitted, it needs to pass along the URL of the original window. If find on th web eight gazillion descriptions of how to pass data...
5
4134
by: Fran Jakers | last post by:
Hello all, I'm new to all this and I could really use some help. I've searched the web but cannot find an answer. I have an HTML form with 3 radio buttons and a search field that calls a...
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7120
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7323
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5050
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.