ASPX templates
Version 7.x > ASPX templates > Forms/Radio Button - Update date field upon change in radio button selection View modes: 
User avatar
Member
Member
bcolanc-aol - 7/9/2013 9:55:52 AM
   
Forms/Radio Button - Update date field upon change in radio button selection
We have radio buttons with values 1,2,3. We are entering a date in the database related to the radio button when the radio button is changed. However, we only want the date to be inserted in the table when the radio button is changed. How do we do this?

Thanks!

User avatar
Member
Member
kentico_sandroj - 7/9/2013 5:25:06 PM
   
RE:Forms/Radio Button - Update date field upon change in radio button selection
Hello,

Without more specifics about your site we can suggest something similar to the following:

<asp:DropDownList ID="MonthDD" runat="server" Enabled="true" onchange="someFunction()">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
</asp:DropDownList>

<script type="text/javascript">

function someFunction() {
alert("Changed");
}

</script>

updateCustomTableItem.SetValue("ItemText", itemText.ToLowerCSafe());


You could use the OnChange event to call a function then update the item in the function. Would this approach work for you? Please let me know if you have any questions or additional information.

Thanks,
Sandro

User avatar
Member
Member
bcolanc-aol - 7/9/2013 9:06:24 PM
   
RE:Forms/Radio Button - Update date field upon change in radio button selection
Sandro,

These are radio buttons on a form. IF the radio button is changed, AFTER submitting the form we want a the new record to insert the date in the table (form). IF the radio button has NOT changed, AFTER submitting the form we DO NOT want the new record to insert the date in the table (form).

User avatar
Member
Member
kentico_sandroj - 7/10/2013 6:13:47 PM
   
RE:Forms/Radio Button - Update date field upon change in radio button selection
Hello,

Thank you for the additional clarification. In this case, you would use global events and the Bizform API. I think you should be able to use the Insert After. Please take a look at these two links and let me know if you have any questions.

Regards,
Sandro