I am trying to learn osticket. I am adding a new custom field to be shown on frontend. I have changed the file open.inc.php with adding the following code
<tr><td colspan="2"><hr />
<div class="form-header" style="margin-bottom:0.5em">
<b><?php echo __('Location'); ?></b>
</div>
</td></tr>
<tr>
<td colspan="2">
<select id="location" name="location" onChange="fetch_select(this.value)">
<option value="" selected="selected">— <?php echo __('Select a State');?> —</option>
<option value='Jalandhar'>Jalandhar</option>
</select>
</td>
</tr>
But nowhere I am able to find the code to add this data to database.
Please guys help me in osticket how I can add this field to database ?
Although you could probably do it this way, osTicket actually has a built-in functionality called "Forms" that allows you to customize your ticket form in whatever way you see fit. Go check that out in the admin under the Forms Setting screen and you can add a select box like what you show in your example.
I recommend you use the built-in functionality instead.