Hi,
When I click a radio button in a certain web page (rather than a text link), I send the user on to another page.
Further requirements gathering in this project mandates that I pass a querystring on to that page.
The querystring is already captured and parsed in the host page and assigned to javascript variables and assigned to form fields.
For reasons of consistancy in Look and Feel, I use a radio button with a label as a link to another page if the user’s needs requires them to go there.
If they do go there, I need to send along that same querystring.
Here is my button click action javascript:
<input type="radio" name="_fid_30"
onClick="window.location='webpage.html'" />
At the end of that ‘webpage.html’, I wish to append the querystring that already is captured in the host page’s URI.
Here is the javascript wherein I’ve captured the querystring:
<script language="javascript">
function getQuerystring(key, default_)
{
if (default_==null) default_="";
key = key.replace(/[\\[]/,"\\\\\\[").replace(/[\\]]/,"\\\\\\]");
var regex = new RegExp("[\\\\?&]"+key+"=([^&#]*)");
var qs = regex.exec(window.location.href);
if(qs == null)
return default_;
else
return qs[1];
}
// CAPTURE QUERY STRING VALUES
var koID_val = getQuerystring('koID');
var UID_val = getQuerystring('UID');
var GivenName_val = getQuerystring('GivenName');
var MiddleInitial_val = getQuerystring('MiddleInitial');
var SurName_val = getQuerystring('SurName');
var Title_val = getQuerystring('Title');
var Email_val = getQuerystring('Email');
var QS_val = "?koID="+koID_val+"&UID="+UID_val+"&GivenName="+GivenName_val+"&MiddleInitial="+MiddleInitial_val+"&SurName="+SurName_val+"&Title="+Title_val+"&Email="+Email_val
</script>
With my last variable, “QS_val”, I’m attempting to capture within that variable the querystring only.
I’ve attempted to append this value at the end of ‘webpage.html’, but when I click the radio button, I arrive at the page, but there is no querystring.
I appreciate any help with passing the querystring on to the next web page when the radio button is clicked.
Chris