Skip to content
Advertisement

Tag: forms

How to get input from form using PHP/Jquery live?

I have a simple HTML form that includes an input field and a submit button. How can I use JQuery to get the text from the input field live and then send that data to a PHP file that evaluates the data? Form: Edit: here’s what I want it to look like Answer Your current code doesn’t need jquery to

Symfony Forms Error: Entity of type “…” passed to the choice field must be managed. Maybe you forget to persist it in the entity manager

Objective I am trying to make a basic form that signs a new player up for a sport. This is taken from the Symfony example at: https://symfony.com/doc/current/form/dynamic_form_modification.html#form-events-submitted-data The Code I have 3 entities: PlayerList https://github.com/ChimeraBlack1/Symphart/blob/main/src/Entity/PlayerList.php Sport https://github.com/ChimeraBlack1/Symphart/blob/main/src/Entity/Sport.php Position https://github.com/ChimeraBlack1/Symphart/blob/main/src/Entity/Position.php I have a form: NewPlayerType https://github.com/ChimeraBlack1/Symphart/blob/main/src/Form/NewPlayerType.php I have a controller: NewPlayerController https://github.com/ChimeraBlack1/Symphart/blob/main/src/Controller/NewPlayerController.php The Error: Details: I seem to get this error

Why does my PHP file stop executing when I use session_start()?

I am creating a login page for a website using PHP. I added “session_start();” as seen below to start the session. Then I put the rest of the websites code below it (other php, html, etc). Whenever I use session_start, the program stops executing and shows a blank page. Also, the page displays error 500 on some browsers. I’m not

How to filed form fields based upon user selection in php?

I’ve build a form but I’m kind of stuck at this thing where I have a yes or no field, and upon selecting yes some of the fields should appear otherwise those should be hidden if the user selects no. I’m not sure how to do it. Here’s the code: Answer New here and also learning. Hope I’m following conventions

Access data in URL using GET and send it to database using POST

I am sending an id using the url. However, i can only access the $GET[‘id’] variable when the page loads. When I go on to submit the form, the variable is undefined. What could be the problem Answer When you build the form, the target should include the GET parameter too. This is how GET parameters are passed around. $_POST

Advertisement