views:

312

answers:

1

I have a form that I pre-populate with test data though jQuery.

$('INPUT[name=subscription.FirstName]').val('Jef');

but I only want to do this before submit. What is the best way to test this?

A: 

Depends on the server side view technology you're using. If it is for example JSP:

<script>
    var isPostback = ${pageContext.request.method == 'POST'};
</script>
BalusC
Not using JSP, but a custom ASP.NET/MVC implementation. Despite that, this answer pointed me in the right direction. Using a server variable in the javascript did the trick, thanks!
bverryt
Good work, but can you please post the exact ASP.NET solution so that others who are have the same problem can benefit from this topic?
BalusC