Question Navigating between https webspeed pages

Potish

Member
What is the recommended solution for navigating between webspeed https pages when page 1 needs to passed hidden fields to page 2.

In the past I have used the javascript below and it has worked well. This script passes user fields through URL parameters. The page I have now needs to use hidden fields because the number of fields can vary and is large.

Current Javascript sample looks as follows

var cSecure = 'myHTTPSurl'
function gotopage2(param1) {
var cURL = cSecure + 'page2.r?param1=' + param1;
document.location.assign(cURL);
}

I call the javascript from webspeed/speedscript as follows

request_method = "get":u.
output-content-type("text/html":U).
{&OUT} " <SCR" + "IPT SRC='/js/pagenav.js' LANGUAGE='JavaScript'></SCR" + "IPT>~n".
{&OUT} " <SCR" + "IPT LANGUAGE='JavaScript' TYPE='text/javascript'>~n".
{&OUT} " gotopage2('" + get-value("param1") + "');~n".
{&OUT} " </SCR" + "IPT>~n".
return error.

Looks for ways to modify this to pass hidden fields or an alternate method I can use to pass hidden fields.
 

lee.bourne

Member
Very brief overview:

<FORM method="POST" name="myForm" action="/cgi-bin/page2.htm">
<INPUT type="hidden" name="field1">
</FORM>
<SCRIPT>
function gotoPage()
{
document.forms.myForm.submit();
}
</SCRIPT>
<A href="#" onclick="javascript:gotoPage()">Go to page 2</A>

This assumes page 1 is also https. If not then change /cgi-bin to https://domain/cgi-bin
 

Potish

Member
Very brief overview:

<FORM method="POST" name="myForm" action="/cgi-bin/page2.htm">
<INPUT type="hidden" name="field1">
</FORM>
<SCRIPT>
function gotoPage()
{
document.forms.myForm.submit();
}
</SCRIPT>
<A href="#" onclick="javascript:gotoPage()">Go to page 2</A>

This assumes page 1 is also https. If not then change /cgi-bin to https://domain/cgi-bin

Both page 1 and page 2 are https. How does this solution pass the input fields from page 1 to page 2 as hidden fields - does the document.forms.myForm.submit(); take care of that?
 

lee.bourne

Member
Both page 1 and page 2 are https. How does this solution pass the input fields from page 1 to page 2 as hidden fields - does the document.forms.myForm.submit(); take care of that?

Yes, the submit will send all of the input elements within the form tags regardless of whether they are hidden fields or not. I think you need to Google for some tutorials on using HTML forms. There are also other methods of passing data between pages such as cookies.
 
Top