StirCrazy Posted May 10, 2007 Share Posted May 10, 2007 I'm trying to figure out how this __doPostBack function works in relation to the date form below. I'm trying to get a commission report for another site and want to find out what variables it posts and in what format. Can anyone help? Sample below. Oh and just a side note (that should be in the PHP forum but you may know) Is it possible to post variables using PHP CURL to an .aspx page? Regards, S.C> <form name="Form1" method="post" action="report.aspx" id="Form1"> <input type="hidden" name="__EVENTTARGET" value="" /> <input type="hidden" name="__EVENTARGUMENT" value="" /> <script language="javascript" type="text/javascript"> <!-- function __doPostBack(eventTarget, eventArgument) { var theform; if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) { theform = document.Form1; } else { theform = document.forms["Form1"]; } theform.__EVENTTARGET.value = eventTarget.split("$").join(":"); theform.__EVENTARGUMENT.value = eventArgument; theform.submit(); } // --> </script> <TABLE id="Table1" cellSpacing="1" cellPadding="1" width="100%" border="0"> <TR> <TD><STRONG class="text"><span id="QuickDateSelector1_lblLangText820">Change date range</span> </STRONG> </TD> <TD></TD> </TR> <TR> <TD><STRONG class="text"><span id="QuickDateSelector1_lblLangText821">From</span></STRONG></TD> <TD><STRONG class="text"><span id="QuickDateSelector1_lblLangText822">To</span></STRONG></TD> </TR> <TR> <TD> <select name="QuickDateSelector1:ddlStartDay" id="QuickDateSelector1_ddlStartDay" class="smalltext" style="font-size:XX-Small;"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> </select> <select name="QuickDateSelector1:ddlStartMonth" id="QuickDateSelector1_ddlStartMonth" class="smalltext" style="font-size:XX-Small;"> <option value="1">Jan</option> <option value="2">Feb</option> <option value="3">Mar</option> <option value="4">Apr</option> </select> <select name="QuickDateSelector1:ddlStartYear" id="QuickDateSelector1_ddlStartYear" class="smalltext" style="font-size:XX-Small;"> <option value="2002">2002</option> <option value="2003">2003</option> <option value="2004">2004</option> <option value="2005">2005</option> <option value="2006">2006</option> <option value="2007">2007</option> </select></TD> <TD> <select name="QuickDateSelector1:ddlEndDay" id="QuickDateSelector1_ddlEndDay" class="smalltext" style="font-size:XX-Small;"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> </select> <select name="QuickDateSelector1:ddlEndMonth" id="QuickDateSelector1_ddlEndMonth" class="smalltext" style="font-size:XX-Small;"> <option value="1">Jan</option> <option value="2">Feb</option> <option value="3">Mar</option> <option value="4">Apr</option> </select> <select name="QuickDateSelector1:ddlEndYear" id="QuickDateSelector1_ddlEndYear" class="smalltext" style="font-size:XX-Small;"> <option value="2002">2002</option> <option value="2003">2003</option> <option value="2004">2004</option> <option value="2005">2005</option> <option value="2006">2006</option> <option value="2007">2007</option> </select></TD> </TR> </TABLE> <a id="QuickDateSelector1_lnkRunReport" class="boldblue" href="javascript:__doPostBack('QuickDateSelector1$lnkRunReport','')" style="width:67px;">Run Report</a><BR> <BR> <STRONG> <TABLE cellSpacing="0" cellPadding="0" width="100%" border="0"> <TR class="text"> <TD style="WIDTH: 92px"><STRONG><span id="QuickDateSelector1_lblLangText823">Quick Links:</span></STRONG></TD> <TD colSpan="3"> <a id="QuickDateSelector1_lnkLast7Days" class="text" href="javascript:__doPostBack('QuickDateSelector1$lnkLast7Days','')">Last 7 days</a>| <a id="QuickDateSelector1_lnkLast30Days" class="text" href="javascript:__doPostBack('QuickDateSelector1$lnkLast30Days','')">Month to date</a> | <a id="QuickDateSelector1_lnkLastCalendarMonth" class="text" href="javascript:__doPostBack('QuickDateSelector1$lnkLastCalendarMonth','')">Last calendar month</a></TD> </TR> </TABLE> </STRONG> Link to comment https://forums.phpfreaks.com/topic/50831-function-__dopostback/ Share on other sites More sharing options...
fenway Posted May 10, 2007 Share Posted May 10, 2007 Looks like it just sets some hidden values and submits the form...? Link to comment https://forums.phpfreaks.com/topic/50831-function-__dopostback/#findComment-250023 Share on other sites More sharing options...
StirCrazy Posted May 10, 2007 Author Share Posted May 10, 2007 thanks fenway. can you tell what variables are sent?... say if I selected 1st January 2007 -> 2nd January 2007 (ie. how is the date formatted when parsed in the form). Thanks for your help. S.C> Link to comment https://forums.phpfreaks.com/topic/50831-function-__dopostback/#findComment-250055 Share on other sites More sharing options...
fenway Posted May 10, 2007 Share Posted May 10, 2007 When what happens? That is, which button/link? Link to comment https://forums.phpfreaks.com/topic/50831-function-__dopostback/#findComment-250089 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.