views:

12

answers:

1

I have a nested form in an asp.net page. This nested form is a login/password which I will pass over to another application. I need to submit the nested form using javascipt. However I am having trouble getting a reference to the nested form.

// this is not working for me:
document.forms[1]submit();

The nested form is a plain html form (doesn't have a runat server) which should only pass over the login and password inpt values.

It actually works fine for me if the 2nd form is not nested, but insted placed below the asp.net form. Is my only option to leave the form at the bottom of the page and use javascript to populate it and submit it?

Does anyone see any security issues with this technique of cross page posting?

+1  A: 

Nesting forms in HTML is not allowed, so yes you have to keep it separate.

Pointy
ok, that is useful feedback, thx. Do you see any security holes with cross page posting a user login and password? (both pages will be HTTPS)
BrokeMyLegBiking
No, if it's HTTPS then the connection is encrypted.
Pointy