func CProgramForm(args *CProgramFormArgs) kyoto.Component[CProgramFormState] {
return func(ctx *kyoto.Context) (state CProgramFormState) {
logrus.Info(" State respons ", state)
// Handle action
handled := kyoto.Action(ctx, "Submit", func(args ...any) {
logrus.Info(" State response:3 ", state)
//state.IsSending = true
// We will just set a new uuid and will print a log
// It's not makes a lot of sense now, but it's just a demonstration example
logrus.Info(" Submit response: ", args)
//time.Sleep(4 * time.Second)
})
// Prevent further execution if action handled
if handled {
return
}
// Write args
state.Args = args
// Get the value of the "slug" parameter from the URL
vars := mux.Vars(ctx.Request)
slug := vars["program-slug"]
// request to get single
state.Periods = getPeriods(slug)
// Return
return
}
}
the components works for the first time rendring after when i fill the form and click submit the "Submit" action has been called but the state of the component rest the component reload when the submit action has been finished and rest the form .and i don't get any arguments from submit action
the goal is when the click the submit form need to get inputs values (i know you are using javascript to get those values from FormData but i don't receive from the server side and also prevent reset the state of component (i lost state.Periods data when submit the form)
Hi sir, Thanks form the awesome framework. sir i'm facing issue with onsubmit="FormSubmit(this, event)" function :
i've declared it in frontend side like that :
this is my component controller :
the components works for the first time rendring after when i fill the form and click submit the "Submit" action has been called but the state of the component rest the component reload when the submit action has been finished and rest the form .and i don't get any arguments from submit action
the goal is when the click the submit form need to get inputs values (i know you are using javascript to get those values from FormData but i don't receive from the server side and also prevent reset the state of component (i lost state.Periods data when submit the form)