|
-
netscape & IE not compatible when passing form to javascript
// included javascript file in form 1
function getBrand(form){
var listobj = form.lstBrand
var selIndex = form.lstBrand.selectedIndex
var brandcode = listobj.options[selIndex].value
var brandname = listobj.options[selIndex].text
form.BrandCode.value = brandcode
form.BrandName.value = brandname
form.target = '_self'
form.action = 'BrandStatistics.asp'
form.submit()
}
// form declaration
<form name="frmBrand" method="post" action="" ID="frmBrand">
FORM 1 invokes getbrand
<select name="lstBrand" size="1" onChange="getBrand(this.frmBrand);" ID="lstBrand">
** This works on IE but not netscape
If I change it to
<select name="lstBrand" size="1" onChange="getBrand(this.form);" ID="lstBrand">
** This works on netscape but not ID
I need a generic way to either pass the form that will work in IE and netscape or away
to access the form in the javascript
I tried to redo and not pass the form but I did not get this to work
function getBrand(){
var listobj = document.form.lstBrand
var selIndex = form.lstBrand.selectedIndex
var brandcode = listobj.options[selIndex].value
var brandname = listobj.options[selIndex].text
document.form.BrandCode.value = brandcode
document.form.BrandName.value = brandname
document.form.target = '_self'
document.form.action = 'BrandStatistics.asp'
document.form.submit()
}
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
|
Bookmarks