java script
- Started
- Last post
- 14 Responses
- Skylark
I got a dropdown menu, where you select the state, and then submit it with a button. My boss wants it to go tot he state without you have to press submit... so I thought that
onChange=SubmitForm() would work if I put that in the input tag
and to use this in head
JS FUNCTION SUBMITFORM {
documnet.formname.submit
}but I dont work...can someone please help me?
- mitsu0
[head]
function hello()
{
form1.submit();
}
[/head]
[form name='form1' id='form1']
[select onchange='hello()']
[/select]
[/form]
- Skylark0
thanks, but I dont get that to work....a javasript erroe occur after I made the selction in the menu?!
- mitsu0
post your code or a link to it.
- Recycle0
You're just missing the parenthesis in the submit() function. Try this:
function SubmitForm() {
document.formname.submit();
}
- unformatted0
onchange='hello();'
missing semicolon
- Recycle0
Javascript doesn't need semicolins, man.
- Skylark0
teh error that comes up says "obejct dosen't support this property or method"
- mitsu0
check your asp, i got it to work when i pulled out you database code.
- Skylark0
so outside the ASP it works...well, sucker as I am...somebody else does the ASP...someone I dont know...
- mitsu0
oh, i took out all your includes... lemme futs around with it summore. (yess that's a real word)
- Skylark0
can the problem be that I have the part that it calls on in the header of header.asp that is included?
- mitsu0
found it. never give a tag name, the name 'submit'. confuses the hell out of it.
so change
input type='submit' name='submit' value='Submit'
to
input type='submit' name='submit1' value='Submit'
or just take it out.
- Skylark0
ahh..thank you so verrry verry much. It works now, and your the MVP (most valueable person) of the day...