I added a new page to the OSTicket version 10 Beta and I am trying to
auto-populate data based on a select option value. I have a customer
that could have multiple locations and each location has a different
address, contact, email, etc...When you select a different location in the dropdown it does a page submit and I get this error:Valid CSRF Token RequiredIf
I take copy that querystring, hit back in the browser and refresh the
page so that it's working properly and paste that querystring into the
url it works. It doesn't change the location in the select option but
all the other data works so the problem is that onchange event with the
select. Here is the code:<form id="customer_form" action="customers.php?t=customer<?='&id='.$cust->getId()?>" method="post"> <table style="width%;border;border-collapse;border-spacing;padding"> <tr> <td width=50%>
<table class="ticketinfo"
style="width%;border;border-collapse;border-spacing;padding;margin
auto;text-align;"> <tr height=30 valign=bottom> <th>Site Name</th> <td>
<select name="location"
onchange='document.getElementById("customer_form").action+="&sub_id="+this.value;document.getElementById("customer_form").submit();'> <?php if (($locs=Cust:($cust->getId()))) { foreach ($locs as $loc) {
$sel=($_REQUEST
&& $_REQUEST==$id)?'selected="selected"':'';
echo sprintf('<option
value="%d" %s>%s</option>',$loc,$sel,$loc); } } ?> </select>Why might this be happening?