Hi
I have a little problem. I have a simple form that takes me to some sth.do, it looks sth. like this:
textfield name
textfield name
dropdown list of items
go button
I use
struts now after I push the go button, form is populated, I am redirected to the action
servlet, values are evaluted, if any errors I return to this page, no problems everything is fine.
Ammong the items I also have new item if new item is selected as an opction I am taken on my way through the new Item webpage and again I come back to the primary site, no problem with repopulating the form since I keep the bean with its values.
But the problem arises when I try to use dropdown list to navigate. WHen I change the focus on my dropdown list I want the page to be reloaded according to the value that is selected on the dropdown list. I use javascript for that. So I basicly redirect to some action servlet that is always used before redirectting to this page. Now my problem is that when i use redirect from the javascript no action form is created or at least I dont know how to do that and I lose the content of name fields. I could pass them as a parameters but it sounds kind of messy. so how can I navigate from the javascript function responding to onchange atribute so my actionForm were populated with the valuse taht are already typed.
this is my javascript,I would like to know if there is any way to use action of the form that the list belongs to, from the javascript after changing focus on the dropdown list
<script type="text/javascript">
<!--
function schoolChange(form){
selInd = document.majorForm.school.selectedIndex;
ID = document.majorForm.school.options[selInd].value;
top.location.href ="major.do?id="+ID;
}
//-->
</script>
I hope you understood ...
Thank you
[ April 29, 2005: Message edited by: Mariusz Bogucki ]
[ April 29, 2005: Message edited by: Mariusz Bogucki ]