Is there a way to "embed" a form in another form - dynamics-ax-2009

I have a form and I want to embed it in another form. I want to keep both form, but I would prefer to avoid duplicating the first form.
Is there a way to "attach" a form to a tab page for example?

No!
Use field groups on the tables to the max and accept the fact.
Or provide a button to the second form.

Related

Django add fields to form dynamically based on number of values in model choice field

Objective:
From a Django Form, modelchoice field i am making the widget display multiple checkboxes. But for each checkbox I would like to display exactly one textbox and then submit. I need to know if the checkbox is not selected, it's id still and the possible textbox value. How do I acheive this, if it is Ajax. please elaborate. as I am fairly new to django and haven't worked much with ajax.
So you have to possible approaches here,
Simpler(but a very tardy approach):
Submit the form after user's checkbox input, process the input in views.py and accordingly serve the other part of the form on a different template. This will lead you to reloading the page and changing URL's for the same form. This approach is fine if you are doing it only to learn Django at first.
The better approach. You can use on page JavaScript/JQuery to determine whether the checkbox is ticked or no and the accordingly show the checkbox. You can do something like
if(document.getElementById('yourCheckBoxID').checked)
{
$("#FormFieldID").show();
}
else
{
$("#FormFieldID").hide();
}
If you are doing the latter, do remember to NOT set the input field as "required", as it may throw up errors when not showing the text field. Use some sort of JS form validation if you have to.
Hope this helps!

Can I create quiz GUI with Django-Forms?

I'm new to django, and I'm working on a quiz project. The idea is to create something similar to this (http://www.stylemint.com/quiz). Basically, there will be a question on each page and the user clicks on an image with the answer. I was planning on using a django form with a radio select input type, however, I'd like the image to act as the radio button (ie, be clickable) and also a click on the image will take you to the next question (instead of having to click submit after each). Is this possible with django, or do I need java?
it's perfectly possible - if you just want a series of images, and clicking on them to take you to the next question you might achieve that by:
Having multiple input fields of type "image" which all submit the form. If you go down that route you'll have to template the forms out yourself or make your own widget.
Using javascript to replace radio buttons with images dynamically. If you do that, it'd be a good idea to make it fall back to a straight list selection for people who don't have javascript.
Ignoring forms altogether and just using a view with a parameter of what the choice is.
Yes, it's completely possible. My suggestion is if you want to save the result in the db use model and model form in django. So, my next suggestion is you can customize model field for combine radio button functionality and image together. But actually you must programming and use a little jquery and javascript to do it.
You may want to see:
https://docs.djangoproject.com/en/dev/topics/forms/modelforms/
https://docs.djangoproject.com/en/dev/howto/custom-model-fields/

How to trigger input's property required on HTML5?

My question is about how can I trigger the validation of required property without using the submit button
More or less I big a huge form, that is divide by a slider(steps), but is just one form. The point is, that form implement ajax at the end to submit the information that is serialize manually with javascript. So the problem is that the required (attribute, property) is not working, so you have to make the rule for empty input manually. I think is a waste, if you can do that with required.
So I want to bind every slide, to the required inputs.
Thank you in advance
Have you tried checkValidity() ( http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#dom-cva-checkvalidatity )?

How to add a new item to a dropdownlist in a create form in MVC 3?

I have a Form to create a new model object and persist it. That form is displayed in a lightbox or popup.
Some fields are dropdownlist showing related info that lives in another table (other model object related to the main model).
What I need to achieve is without leaving the creation form, create a new item of the related type and update the DropDownList in order to continue filling fields and finaly submit the form.
I have done this in winforms but not really sure which is the best approach in MVC 3:
Trigger another popup with a small form?
Use some kind of editable dropdownlist?
Place a small hidden form right next/after the DDL to allow entering the info to create an item in DDL (and to DB also)?
What do you thing is the best option?
Thanks!
There is no editable dropdown list in HTML. There are some toolkits that simulate it, but in general these are clumbsy and really complex. It's a lot easier to stick with basic controls.
You would proably do best to have a small + sign next to the field, and then popup an editing field that inserts the element into the combobox and sends it to the controller via ajax to add to the database.
An alternative to a second pop up is having a toggle add button. When toggled, then show a small area where you can enter the name. Using ajax, save the name, and then refresh your dropdown. This works well if you only have a few attributes to fill in.

Web Form with more than 100 fields

What would be the best design layout for a web form with more than 100 fields? Right now I have grouped the fields to tabs.I am having tough time in validating the fields.I should either validate it on 'Submit' of the form or on tab change.Both has its own drawbacks. If I validate on tab change then user cannot view other tabs till they fill all the mandatory fields in the previous tab.Also it is not an good idea to throw so many validation messages to the user when he submits the form.
Please share your thoughts..
You can use a stepwise process. In the first step provide all the most important fields. Then on the click of a 'Next' button you can go to the next step and so on. By validating the fields you can allow the user to go to the next step.

Resources