I have a form that has an action. I am trying to redirect the page to another action using javascript after setting some cookies.
My question is will the struts-config.xml action always be in control even though you are trying to change action and submit it using javascript.
I get to here alert("first try made it here "); but I never get the following to happen. It just stope.
frm.action = "acms/int/intakeHistory.do?function=getInt";
frm.submit();
Is there something that I am missing.
JAVASCRIPT
if (cookie == null){
deleteCookie("JSUBJECTID");
setCookie ("JSUBJECTID", value, null, "/");
alert("first try made it here ");
frm.action = "acms/int/intakeHistory.do?function=getInt";
frm.submit();
alert("dam I am here");
ACTION
<action path="/getassignsum"
type="com.test.web.struts.int.IntAssignummaryAction"
name="IntAssignummaryActionForm"
validate="false"
input="/assignmentsum.do"
scope="request">
<forward name="success" path="/assignmentsum.do"/>
<forward name="accessdenied" path="/toregistry.do?prefix=&page=/accessdenied.do"/>
</action>
FORM
<html:javascript formName="IntAssignummaryActionForm"/>
<script language="JavaScript">
window.onload = function()
{
setInputFocus("fromDateAsString");
}
</script>
<script language="JavaScript">
function isSubjectConsolidated(consolidatedToPDJ)
{
if(consolidatedToPDJ != 'N/A')
{
var msg='This minor has been consolidated with '+ consolidatedToPDJ +'. Please search for this minor under '+ consolidatedToPDJ;
alert(msg);
return true;
}
return false;
}
function setSubjectId (value,consolidatedToPDJ)
{
if(isSubjectConsolidated(consolidatedToPDJ))
{
return false;
}
var cookie = getCookie("GETSUBJECTID");
if (cookie == null){
deleteCookie("JSUBJECTID");
setCookie ("JSUBJECTID", value, null, "/");
alert("first try made it here ");
frm.action = "acms/int/intakeHistory.do?function=getInt";
frm.submit();
alert("dam I am here");
}
else
{
setCookie ("COMPANIONSUBJECTID", value, null, "/");
}
alert("made it here ");
/* return true; */
frm.action = "acms/int/intakeHistory.do?function=getInt";
frm.submit();
alert("what happen. I am suppose to be gone");
}
function getSubjectId ()
{
return getCookie ("JSUBJECTID");
}
function deleteSubjectId ()
{
deleteCookie ("JSUBJECTID");
}
</script>
<c:set var="SCREEN_TITLE" value="Intake Assignment Summary" scope="request"/>
<html:form action="/getassignsum.do">
Howard
My question is will the struts-config.xml action always be in control even though you are trying to change action and submit it using javascript.
I get to here alert("first try made it here "); but I never get the following to happen. It just stope.
frm.action = "acms/int/intakeHistory.do?function=getInt";
frm.submit();
Is there something that I am missing.
JAVASCRIPT
if (cookie == null){
deleteCookie("JSUBJECTID");
setCookie ("JSUBJECTID", value, null, "/");
alert("first try made it here ");
frm.action = "acms/int/intakeHistory.do?function=getInt";
frm.submit();
alert("dam I am here");
ACTION
<action path="/getassignsum"
type="com.test.web.struts.int.IntAssignummaryAction"
name="IntAssignummaryActionForm"
validate="false"
input="/assignmentsum.do"
scope="request">
<forward name="success" path="/assignmentsum.do"/>
<forward name="accessdenied" path="/toregistry.do?prefix=&page=/accessdenied.do"/>
</action>
FORM
<html:javascript formName="IntAssignummaryActionForm"/>
<script language="JavaScript">
window.onload = function()
{
setInputFocus("fromDateAsString");
}
</script>
<script language="JavaScript">
function isSubjectConsolidated(consolidatedToPDJ)
{
if(consolidatedToPDJ != 'N/A')
{
var msg='This minor has been consolidated with '+ consolidatedToPDJ +'. Please search for this minor under '+ consolidatedToPDJ;
alert(msg);
return true;
}
return false;
}
function setSubjectId (value,consolidatedToPDJ)
{
if(isSubjectConsolidated(consolidatedToPDJ))
{
return false;
}
var cookie = getCookie("GETSUBJECTID");
if (cookie == null){
deleteCookie("JSUBJECTID");
setCookie ("JSUBJECTID", value, null, "/");
alert("first try made it here ");
frm.action = "acms/int/intakeHistory.do?function=getInt";
frm.submit();
alert("dam I am here");
}
else
{
setCookie ("COMPANIONSUBJECTID", value, null, "/");
}
alert("made it here ");
/* return true; */
frm.action = "acms/int/intakeHistory.do?function=getInt";
frm.submit();
alert("what happen. I am suppose to be gone");
}
function getSubjectId ()
{
return getCookie ("JSUBJECTID");
}
function deleteSubjectId ()
{
deleteCookie ("JSUBJECTID");
}
</script>
<c:set var="SCREEN_TITLE" value="Intake Assignment Summary" scope="request"/>
<html:form action="/getassignsum.do">
Howard