I am new to ASP.net and have this code on a page:
<% IF (Request.Form("clicked")="clicked") %>
<script>
jQuery(document).ready(function(){
jQuery.colorbox({
iframe : true,
innerWidth : 430,
innerHeight : 208,
href : "/v/browse_market.asp"
});
});
</script>
<%ELSE%>
<%END IF%>
Basically I only want the Colorbox to load if the user has come to the page through a form button that was clicked. The form on the previous page is here:
<form method="post" action="/clothing_s/1814.htm">
<input type="hidden" name="clicked" value="clicked" />
<input type="submit" name="submit" value="Browse Products" />
</form>
There are other ways to get to the page and the Colorbox loads even if I haven’t submitted the form. Is my syntax correct? I am very familiar with conditional structures etc. but am mainly a PHP user so am not sure if I got that entirely right (it looks right in relation to examples I’ve seen that’s why I ask).
Wait wait. Why is your FORM tag looking like this:
The action should be targeted to a valid ASP.Net webpage running under IIS. A valid FORM tag may look something like this if you are running ASP.Net page on your own machine (local).
Rest of the code seems fine, it should work.
Having said that, I am not saying that whatever you have written SHOULD be written this way. You wrote ASP.Net in a PHP style, which is not correct. But it must work at least.
I hope this answers your question. If yes, please mark it as “answered”.