Forum Moderators: open

Message Too Old, No Replies

asp.net and javascript form submits

         

musicales

3:28 pm on Jun 6, 2006 (gmt 0)

10+ Year Member



Can anyone tell me why the following isnt working. It's supposed to make the upload box disappear when the use has selected a file. It works in a standard html page but doesn't seem to work when I do it in a .net page. It looks as if the file field doesn't actually get sent this way, possibly due to the way "code behind" works? - but I'm not a .net expert so I'm note sure. Can anyone help?

<head>
<script language=javascript>

function doch(form)
{
document.getElementById('zform1').style.display='none';
document.getElementById('zform2').style.display='block';
form.submit()
}
</script>
</head>
<body>
<div id=zform1>
<form runat="server" form-data="form-data" multipart="multipart">

<input onchange="javascript:doch(this.form)" id="fileUpload1" type="file" size="30" runat="server" /></td>
</form>
</div>

<div style="display:none" id=zform2>

<font face=arial>Uploading File. Please wait. </div>

TheNige

8:15 pm on Jun 8, 2006 (gmt 0)

10+ Year Member



Are you using visual studio? If so, use the debugging features to see what is happing once the post back occurs.