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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JS include

Status
Not open for further replies.

Kendel

Programmer
Joined
Apr 24, 2002
Messages
1,512
Location
US
Hi,

I'm trying to hide my form's fields in the javascript include file. I need to submit the form to a new window. Can someone help me please?

Code:
<form name=myForm method=post action="[URL unfurl="true"]http://www.myotherpage.com">[/URL]
<input type=hidden name=empid value="....">
<input type=hidden name=empName value="....">
<select name=Dept>
  <option value=Dept1>Dept1</option>
  <option value=Dept2>Dept2</option>
  <option value=Dept3>Dept3</option>
</select>
<input type=sumit name=btnSumit value=submit>

I need to use window.open to control the size, status bar...features. When the form is submitted, I can call a javascript funtion but how can I pass the Dept value I have selected? I'm using JSP. Thanks.
 
Never mind, I found the answer:

Code:
s = document.getElementById("quanity");
document.getElementById("ssl_amount").value = 
s.options[s.options.selectedIndex].value;

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top