kevenj
03-26-2003, 08:18 PM
Can someone help me with this?
I am trying to incorporate mutliple javascripts into one form
to get my desried result:
First, Can anyone tell me why this will NOT display
the month:
<SCRIPT language="JavaScript">
today = new Date();
document.writeln(today.getMonth()+today.getDate() +", " +today.getYear())
</SCRIPT>
and how do I display the above result in a particular text filed of my form labled date, which will ultimatley be stored in a db?
Lastly, I have created an array that is essentially a drop down list. When the user selects one of the options I am trying to get some text associated with that array in a text field. I can do it but the text field is very looong. How do I get the text to wrap instead.Here is the code:
<SCRIPT LANGUAGE="JavaScript">
// the data
var regionalOffices = new Array("Sales, Promotions, & Operations", "General Mgr, Business Office, Corporate Mgmt, Exec. Asst., Sales Mgmt, Promotions Dir, Station Mgr, Traffic", "Programming, Engineering, Program Dir, News Dir")
var regionalManagers = new Array("Compaq EVO D510 Small Form Factor, 2.0+Ghz,40GB Hard Drive,256MB Memory,CD-Rom,3 Year Warranty", "Compaq EVO D510 Mini-Tower CMT,2.0+Ghz,40GB Hard Drive,256MB Memory,CD-Rom,3 Year Warranty", "Compaq EVO D510 Mini-Tower CMT +, 2.0+Ghz, 80GB Hard Drive, 512MB Memory, CD/RW, 3 Year Warranty")
// do the lookup into parallel arrays
function getData(form) {
var i = form.offices.selectedIndex
form.manager.value = regionalManagers[i]
}
</SCRIPT>
</HEAD>
<BODY onLoad="getData(document.officeData)">
<H1>Purchase Requisition Form</H1>
<HR>
<FORM NAME="officeData">
omputer is For:
<SELECT NAME="offices" onChange="getData(this.form)">
<OPTION>Sales, Promotions, & Operations
<OPTION>General Mgr, Business Office, Corporate Mgmt, Exec. Asst., Sales
Mgmt, Promotions Dir, Station Mgr, Traffic
<OPTION>Programming, Engineering, Program Dir, News Dir
</SELECT>
</p></P>
<P>
<INPUT TYPE="text" NAME="manager" SIZE=135>
</P>
<P>
<input type="reset" name="Reset" value="Reset">
</P>
<P><BR>
</P>
</FORM>
</BODY>
</HTML>
thanks
I am trying to incorporate mutliple javascripts into one form
to get my desried result:
First, Can anyone tell me why this will NOT display
the month:
<SCRIPT language="JavaScript">
today = new Date();
document.writeln(today.getMonth()+today.getDate() +", " +today.getYear())
</SCRIPT>
and how do I display the above result in a particular text filed of my form labled date, which will ultimatley be stored in a db?
Lastly, I have created an array that is essentially a drop down list. When the user selects one of the options I am trying to get some text associated with that array in a text field. I can do it but the text field is very looong. How do I get the text to wrap instead.Here is the code:
<SCRIPT LANGUAGE="JavaScript">
// the data
var regionalOffices = new Array("Sales, Promotions, & Operations", "General Mgr, Business Office, Corporate Mgmt, Exec. Asst., Sales Mgmt, Promotions Dir, Station Mgr, Traffic", "Programming, Engineering, Program Dir, News Dir")
var regionalManagers = new Array("Compaq EVO D510 Small Form Factor, 2.0+Ghz,40GB Hard Drive,256MB Memory,CD-Rom,3 Year Warranty", "Compaq EVO D510 Mini-Tower CMT,2.0+Ghz,40GB Hard Drive,256MB Memory,CD-Rom,3 Year Warranty", "Compaq EVO D510 Mini-Tower CMT +, 2.0+Ghz, 80GB Hard Drive, 512MB Memory, CD/RW, 3 Year Warranty")
// do the lookup into parallel arrays
function getData(form) {
var i = form.offices.selectedIndex
form.manager.value = regionalManagers[i]
}
</SCRIPT>
</HEAD>
<BODY onLoad="getData(document.officeData)">
<H1>Purchase Requisition Form</H1>
<HR>
<FORM NAME="officeData">
omputer is For:
<SELECT NAME="offices" onChange="getData(this.form)">
<OPTION>Sales, Promotions, & Operations
<OPTION>General Mgr, Business Office, Corporate Mgmt, Exec. Asst., Sales
Mgmt, Promotions Dir, Station Mgr, Traffic
<OPTION>Programming, Engineering, Program Dir, News Dir
</SELECT>
</p></P>
<P>
<INPUT TYPE="text" NAME="manager" SIZE=135>
</P>
<P>
<input type="reset" name="Reset" value="Reset">
</P>
<P><BR>
</P>
</FORM>
</BODY>
</HTML>
thanks