This is my first time asking questions on StackOverflow, and I will be as much specific as I can.
When I opened the website with my Chrome, Firefox and IE, the submit button 'upgrade' works fine after I selected a file to upload/upgrade to the server (my router).
But when I'm trying it on my C# Winform project using the "WebBrowser" component, the submit button doesn't response at all (after I selected the file) whether I'm manually clicking the button or writing C# code to trigger the onClick event.
Does anyone have a clue? Any help would really be appreciated, thanks!
P.S. I'm sorry I can't provide to much picture about the webpage because I'm currently working under a company.
This is the what the webpage looks like
The html code of the webpage is showed below:
<table>
<td>
<label class="subtt2" style="margin-bottom:8px;font-size:14px">
Software Image:
</label>
</td>
<td>
<div class="file-box">
<input id="firmware" name="fupgrade.bin" class="file"
onchange="getfileName()" type="file" style="cursor:pointer">
<input id="filename" class="txt" type="text">
<input class="btnWtn" value="Browse" type="button">
<label class="error" id="lupgradeforbidden" style="display: none"></label>
</div>
</td>
</table>
<div class="buttonStyle" align="left">
<input name="UPLOAD_ACTION" id="UPLOAD_ACTION" value="Upgrade"
onclick="upgradeRouter()" type="button">
</div>
The upgradeRouter()
is as follows:
function upgradeRouter()
{
var FIRMWARE = document.getElementById( "firmware" );
var UPLOAD_ACTION = document.getElementById( "upload_action" );
if( FIRMWARE.value == "" )
alert( "Please select firmware file" );
else
{
fileSize = FIRMWARE.files.item(0).size;
if(fileSize > 0)
{
if( uploading == 0 )
{
document.forms["myForm"].submit();
setTimeout("firmware_update_query_request();", POLLING_FW_STATUS_SECONDS*1000);
document.getElementById('upgradeFrame').style.display = 'none';
document.getElementById('upgradeModalBox').style.display = 'block';
UPLOAD_ACTION.value = "Cancel";
uploading = 1;
}
else
{
uploading = 0;
UPLOAD_ACTION.value = "Update";
myForm.reset();
}
}
}
return false;
}