command = Request.Form("hid");
Response.Write(“Value” & command); -- The value is not printed (Reason found after
analysis that may be because the form is not submitted
alert("before"); -- This message box appears
**document.form.submit();** -- after a lot of analysis the conclusion is that
this submit statement stops working (as on the status
bar 'Opening https:.....File1.asp?form=...' is not
displayed when 'after' message box appears
alert("after"); -- This message box appears
<% if command = "FIND" then
Response.Write ("Inside Find"); -- This message is not printed.
// some functonality
<input type="hidden" name="hid" value="">
This full code works fine on my machine. But this code does not work properly when run on the client-side!, although the same server and the same deployed application is being accessed. There is no particular sequence/scenario but for eg.
When say button1 clicked->window1 opens->window2 is opened->value selected->returned to window1->Clicked on Find-> clicked on Ok->returned on the main page.
Then repeated the same scenario for say 3rd button.
(Till now 'Find' link works fine).
Now repeated the same scenario for 2nd button and here 'after' message is obtained but 'inside Find' is not printed!!
document object doesn't have a
The code only works if you have the attribute
name="form" on the form, and only if there is a single form with that name on the page. That is a bad name for a form, as there are other objects in the DOM that actually have a
form property (i.e. fields in a form).
You should give an unambiguous name to the form, and use the
document.forms collection to access the form instead of relying on that the form is added to the document namespace.