473,322 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

passing form values from a function

I'm using the function below to submit a form based on a onclick event.
I want to ad something to the function that will pass as a request.form valaue but am not sure how to do it.


Thansk

Expand|Select|Wrap|Line Numbers
  1.  function uClicked (theBox,myval){ 
  2.   var f = document.forms.form1;
  3.  
  4.  
  5.       f.submit();
  6.         if (!theBox.checked)
  7.          alert (myval); 
  8.        }
  9.  
Jul 25 '07 #1
3 1098
pbmods
5,821 Expert 4TB
Heya, dashley. Welcome to TSDN!

Use [code=javascript] to open CODE blocks. Thanks!

Check out this thread.
Jul 25 '07 #2
PbMods


Thanks. I've been pounding on this for a few hours in one form or another.
I added a hidden input field called whichcb and used your
document.getElementById('whichcb').value = myval;

and added my values in it and it worked fine.


Thanks Again

dan

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. <script language="javascript">
  4.  function uClicked (theBox,myval){ 
  5.   var f = document.forms.form1;
  6.       document.getElementById('whichcb').value = myval;
  7.       f.submit();
  8.        }
  9. </script>
  10.  
  11.  
  12.  
Jul 25 '07 #3
gits
5,390 Expert Mod 4TB
hi ...

moved the thread from the articles section to the forum ... even if you solved the problem ... i consider the original post as a question rather than an article ;)

kind regards

MODERATOR
Jul 25 '07 #4

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

Similar topics

2
by: kie | last post by:
hello, when i create elements and want to assign events to them, i have realised that if the function assigned to that element has no parameters, then the parent node values can be attained. ...
7
by: Dave A | last post by:
I have two events in a form that I am passing. One is to a javascript function, the other is to the same .asp page only with another action to show different data. Onchange is calls the...
3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
10
by: Noozer | last post by:
Below is some ASP, HTML and javascript. It is part of a page used to maintain a small database. This code did work at one time, but has since stopped. For some reason the data on my form is not...
11
by: John Pass | last post by:
Hi, In the attached example, I do understand that the references are not changed if an array is passed by Val. What I do not understand is the result of line 99 (If one can find this by line...
1
by: | last post by:
Hi, 1st, I did a search and could not find any info on this, the Google results were good, but I'm still have issues...So any help will be great. I have a frame page, which contains 3 frames...
13
by: Deano | last post by:
Apparently you can only do this with one value i.e Call MyAssetLocationZoom(Me!txtLocation, "Amend data") This runs; Public Sub MyAssetLocationZoom(ctl As Control, formName As String) On...
3
by: Ross McLean | last post by:
Hi all, I've been teaching myself C# for a new project at work. I have a bit of a background in c++ and java but never been what you could call a guru. I'm having some strange things happening...
6
by: vncntj | last post by:
I have this home.js file and I'm trying to collect the values on the other at "emplist.aspx" function poponload() { testwindow= window.open ("emplist.aspx", "mywindow",...
5
by: jmartmem | last post by:
Greetings, I have built an Update Record Form in an ASP page. This form contains a number of fields, such as text boxes and menus, to name a few. Upon clicking the 'submit' button, I want the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.