php - Generating symfony2 form on Bootstrap popover is slow

715

Generating forms using Symfony2 is nice when you go from one page to another, but when you want a form to be generated on the fly and attached to a bootstrap popover, it really slows down the popover from showing (or the form itself) because of the AJAX request/response (which gives back the symfony2 form html).

I have a calendar, much like Google Calendar and I want a form to be generated for each slot clicked on it. Google Calendar is really nice and smooth, and opens the popover alongside a text field instantly, no lags. How can I achieve that smoothness and still keep using Symfony2 forms?

Right now I've disregarded Symfony2 forms to handle the issue but I don't like doing it this way. I've attached this html form directly and I'm handling the processing using the Request object parameters in Symfony2 conroller:

<form role="form" data-form="schedule-picker">
<div >
<select data-type="start-time" name="startTime">
<option selected value="0">START TIME</option>
</select>
</div>
<div >
<select data-type="end-time" name="endTime">
<option selected value="0">END TIME</option>
</select>
</div>
<div >
<textarea placeholder="Description..." data-type="description" name="description"></textarea>
</div>
<input type="hidden" name="tutorId" value="5" />
<div >
<input type="submit" value="BOOK SESSION" />
</div>
</form>

People are also looking for solutions to the problem: php - Instantiation of new object or reusing the same one for storing data

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.