How do I make a django form more aligned - django-forms

I have a form to edit my Wikipedia entry but since its a django form I am having difficulty designing it
This is the code for the form
class EditForm(forms.Form):
title = forms.CharField(label="Edit Title")
body = forms.CharField(label="Edit Body", widget=forms.Textarea(
attrs={'rows': 1, 'cols': 10}))
Any help would be appreciated, Thanks in advance!

You can try using Django Crispy Forms, read the documentation on this page

Related

Vue router.push: How to check if component or content is loaded?

As per all my post, I just want to make it known that I am still new to Laravel + VueJS, so please be as detailed as possible when posting your answers or comments. Thanks.
I am using Vue's router.push() to retrieve pages. Example code as follows:
editHandler(id) {
let self = this
self.$router.push({ name: 'inventory/Suppliers/Edit', params: { id }
})
}
I planned to add a loading overlay on the onClick event but I need help to check when the component/content has been loaded so that I can hide the loading overlay. Anyone can help me how I can achieve this? Thanks.

dropzone.js - how to control where thumbnails appear

I have a nice drop down area, but if I set that to class"dropzone" then the form elements are not sent.
If I add class"dropzone" to the form, then the form elements are sent, but the thumbnails appear under the form, the submit button, etc.
How please do I tell dropzone to use my template at id "#dropzone_thumbs_here" or class ".dropzone_thumbs_here". Do I have to fully write my own thumbnail handler? Or send form details separately? Or is there a better method !!
Sorry, I missed the answer because in the documentation it was under tips and not configuration.
In the config parameters, just added:
previewsContainer: "#myPreviewContainerID",

Howto Wordpress + Ajax + Custom Post Type + Custom Metabox + Contact Form 7

here's the situation:
I have a page generated from a custom post type in Wordpress.
This page has a custom metabox with a "thank you" message.
In this page there is a contact form generated with Contact Form 7.
What I would like to archive is that when someone submits the post, a ajax function replaces the form with the content in the metabox.
Now the content in the metabox has also some script (tracking codes) that I don't want to load before the the form is submitted.
Any suggestions?
Thanks in advance!
It is possible to do what you want but since you are using CF7 it requires quite a lot of customisation.
It would be way easier to achieve the desired result if you could hardcode the php form into the page.
Let me know if that's an option for you and maybe I can give you an hand.

How to pass AJAX POST data to jQuery nyroModal?

Ealier I tried using same functionality with colobox but could not success, now I'm trying to use nyroModal and trying to send ajax data using post method with iframe. But its not going through. Here is the code which I have tried:
var src = "this is test data';
$.nmManual('try_python.php',{
callbacks: {
initFilters: function(nm) {
nm.filters.push('link');
nm.filters.push('iframe');
},
ajax:{data:'code='+src, type:"post"}
}
});
I'm able to open iframe and content from try_python.php is properly displayed in the frame but passed data is not accessible to try_python.php.
I will really appreciate you for any input in this regard.
Kind Regards
Mohtashim
I could not success in posting my content using POST method but I found a workaround where did the following:
(a) Saved my content in a hidden <div id="source" style="display:none;">...</div>
(b) Access this content from the iframe window upon successful load using the following:
var code = window.parent.$("#source");
and this is what I wanted to have....May be it will help many others. If you find a solution to pass direct content using post method kindly share.

Newbie - Blank pdf using CodeIgniter and mPDF

I'm new to CodeIgniter and even newer to mPDF and I'm having some brain trouble in trying to create a single-page invoice from an existing View. Code is as follows:
$this->load->library('mpdf');
$to_convert = $this->load->view('test_pdf_view',TRUE);
$this->mpdf->WriteHTML($to_convert);
$this->mpdf->Output();
Any help would be greatly appreciated.
Thank you :-)
You need to pass TRUE as the third parameter to the view:
$to_convert = $this->load->view('test_pdf_view', NULL, TRUE);

Resources