Good day!
I have a DVWP. DVWP has parameters as query string "StartDate" and "DateEnd" and filters on datefield "Date" by parameters "StartDate" and "EndDate".
Also I have form on the page with javascript.
function getparam()
{
var startdate = document.getElementById("datepicker").value;
var enddate = document.getElementById("datepicker").value;
var date = startdate.split("-");
var stringstart = date[2]+"-"+date[1]+"-"+ date[0]+"T00:00:00Z";
date = enddate.split("-");
var stringend = date[2]+"-"+date[1]+"-"+ date[0]+"T23:59:59Z";
var strUrl = window.location.toString()+"?StartDate="+stringstart+"&EndDate="+stringend;
}
<div id="panelDay" style="display:block;">
Choose Date: <input type="text" id="datepicker"/><br/>
<input name="Button1" type="button" value="button" onclick="getparam()" />
</div>
I'm not sure if i prepared the query string "strUrl" right.
Question: How can I send theese parameters to DVWP, so DVWP will be filtered?
I tried this if( PreSaveAction() ) {ddwrt:GenFireServerEvent('__redirect(strUrl)')}; but it doesn't work for me.
(And i don't want to use DateFilter WP for some reasons)
Updated So I did This
__doPostBack('ctl00$m$g_3375d095_c73e_4b32_86b1_d90170c4f5e2','NotUTF8;StartDate={'+ stringstart +'};EndDate={'+ stringend + '}');
But I had to change my parameters from "QueryString" to "Postback;Connection;" and it works now. But I still can't figure out how should i use doPostBack with Query string paramters. Should I use redirect?so i can see HTML code of this __doPostBack
ddwrt:GenFireServerEvent('__commit;__redirect={http://myadd/sites/redirect.aspx?StartDate= stringstart&EndDate=stringend}')