Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing a value from a function

Status
Not open for further replies.

Dashley

Programmer
Dec 5, 2002
925
US

Im using this function to submit a form.
Is there a way from inside the function to pass a value as a request.form variable so I know that it was this function that submitted the form?


Thanks


Code:
 function uClicked (theBox,myval){ 
  var f = document.forms.form1;
        if (!theBox.checked) 
         alert (myval); 
          f.submit();

      }

[code]
 
Maybe declaring a hidden field in the form and setting the value.

Cheers,
Dian
 
are you taliknig about seeting
the value from the function?
 
Ok I got it. Thanks

<script language="javascript">
function uClicked (theBox,myval){
var f = document.forms.form1;
document.getElementById('whichcb').value = myval;
f.submit();
}
</script>



<input type="hidden" id="whichcb" name="whichcb">

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top