#Help regarding radio button input in Spring boot and JPA

1 messages · Page 1 of 1 (latest)

woven crest
#

Hello everyone, i created a database using spring jpa and inserted data in it using the input from my html page form. Now, whenever i use String variable to store the typed data, JPA can easily map it and create the db, while I'm unable to store the type of data if it is a radio button or date type input. I wanted to know as to how I could store radio button values and input type date values in my database which was created using Spring JPA. Any type of help would be appreciated,thanks!

ember vesselBOT
#

<@&1004656351647117403> please have a look, thanks.

unique crystal
#

based on the description uve provided, it seems that you're working on a web application in 2 sides frontend and backend

#

a radio button is used to pick an option from a list

#

and as each element in a list must have a unique ID, you can use it

#

as for Date, in spring you can use LocalDate or Instant types

#

so if your clientside app sends a string like this "2024-01-01", it could be accepted in spring as a date object

woven crest
#

I see, so in my html form if i use input type as radio for gender, i will still be able to map the gender field in database as string right? Meaning it will still be able to take input?

woven crest