J
James
Hello everyone,
While loading a page
(http://www.edmonton.ca/portal/server.pt?space=CommunityPage&control=SetCommunity&CommunityID=239)
into a webbrowser control I use invokemember on the 'onclick' event from
'cmdBusStopScheduleSubmit' element - see below.
ONCLICK
=========
<input type="submit" name="cmdBusStopScheduleSubmit" value="Get Bus Stop
Schedule" id="cmdBusStopScheduleSubmit" class="formBtnText"
onclick="if (ValidateBusStopSchedule())
{
gfnTransit_SwitchPostBackUrl('BusStopSchedule.aspx|BusStopLookup.aspx','BusStopSchedule_Results.aspx','frmBusStopScheduleForm','_blank','NOVIEWSTATE');
}
else {
return false;
}"
style="height:40px;width:155px;" />
FUNCTIONS
===========
I have located the two functions inside the onclick event:
function RouteSchedulePostBack(eventTarget, eventArgument,strFormName,
strTargetField, strTargetValue)
{
var theform = document.forms[strFormName];
theform.__EVENTTARGET.value = eventTarget.replace(/\$/g, ":");
theform.__EVENTARGUMENT.value = eventArgument;
//check if value needs to be passed through to form submit
if (strTargetField != '')
theform[strTargetField].value = strTargetValue;
theform.submit();
}
function gfnTransit__doPostBack(eventTarget, eventArgument, strFormName) {
var theform = document.forms[strFormName];
theform.__EVENTTARGET.value = eventTarget;
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
The page does not refresh nor does it load any other page. However, if I use
Focus and have the cmdBusStopSchedule focused, I can press the space bar and
it will work as planned. If I leave the Bus Stop field empty, I get an alert
with either method - Invokemember or focus/space bar.
It must be the gfnTransit or the RouteSchedulePostBack functions. What I do
not understand is why the Focus and Space bar makes a difference? Is it
possible to remove the onclick event and put in my own? I just want the
BusStopSchedule.aspx to run.
Would it be best to find a javascript form?
Any thoughts would be apreciated...
-James
While loading a page
(http://www.edmonton.ca/portal/server.pt?space=CommunityPage&control=SetCommunity&CommunityID=239)
into a webbrowser control I use invokemember on the 'onclick' event from
'cmdBusStopScheduleSubmit' element - see below.
ONCLICK
=========
<input type="submit" name="cmdBusStopScheduleSubmit" value="Get Bus Stop
Schedule" id="cmdBusStopScheduleSubmit" class="formBtnText"
onclick="if (ValidateBusStopSchedule())
{
gfnTransit_SwitchPostBackUrl('BusStopSchedule.aspx|BusStopLookup.aspx','BusStopSchedule_Results.aspx','frmBusStopScheduleForm','_blank','NOVIEWSTATE');
}
else {
return false;
}"
style="height:40px;width:155px;" />
FUNCTIONS
===========
I have located the two functions inside the onclick event:
function RouteSchedulePostBack(eventTarget, eventArgument,strFormName,
strTargetField, strTargetValue)
{
var theform = document.forms[strFormName];
theform.__EVENTTARGET.value = eventTarget.replace(/\$/g, ":");
theform.__EVENTARGUMENT.value = eventArgument;
//check if value needs to be passed through to form submit
if (strTargetField != '')
theform[strTargetField].value = strTargetValue;
theform.submit();
}
function gfnTransit__doPostBack(eventTarget, eventArgument, strFormName) {
var theform = document.forms[strFormName];
theform.__EVENTTARGET.value = eventTarget;
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
The page does not refresh nor does it load any other page. However, if I use
Focus and have the cmdBusStopSchedule focused, I can press the space bar and
it will work as planned. If I leave the Bus Stop field empty, I get an alert
with either method - Invokemember or focus/space bar.
It must be the gfnTransit or the RouteSchedulePostBack functions. What I do
not understand is why the Focus and Space bar makes a difference? Is it
possible to remove the onclick event and put in my own? I just want the
BusStopSchedule.aspx to run.
Would it be best to find a javascript form?
Any thoughts would be apreciated...
-James