Currently working with Zend Sub form in Zend framework to achieve Multi page form.
This is the example i'm using at the moment
http://framework.zend.com/manual/en/zend.form.advanced.html
Managed to get everything working nicely but I wanted to have a 'Back' button on the forms so when the users press on the “back” button the previous form will re display with entered data.
I'm wondering is there any tutorial on the net teaches this or is it easy to code this functionality?
Thank you so much. PS I Love stackoverflow community :)!
Its a structuring and naming thing.
I'm going to psuedo-code and talk you through this, let me know if you need me to type out a full example
Assumption:
MultiPageForm has many SubForms that represent pages.
when you add these subforms to the parent form you name them something intelligent.
so for example, if your form was at /register, use an optional url paramater */register/page/{that_intelligent_subform_name_from_before}* to build out a navigation
<ul>
<li>Step 1</li>
<li>Step 2</li>
<li>Step 3</li>
</ul>
then in your controller:
1. pull out the page param
2. fetch the subform with that name from the multipage form
3. prepopulate the subform
4. send the subform to the view
Related
Hello I'm trying to include in a modal a custom form (is not a BizKentico Form) when it is rendered the tag <form> is missing and when click submit buttom it realod the page and lose de input data before.
Are you using Portal engine or MVC?
If you are using Portal, Kentico wraps the entire page in a form tag. You can hack it buy doing something like this, but it may cause some issues on the page.
</form>
<form>
your form data
</form>
<form>
I'm working on a magazine page. Therefor I would like the client to be able to select the design type when creating/editing a new post. So I'd like to add a custom field to the "edit news", something like a dropdown where all the news (design) types are listed.
For example: News Types:
Normal
Interview
Date
Special Event
etc...
When the client doesn't select anything it should fallback to a default i.e "Normal" and also it would be nice that when the client selects Interview a second input field shows up where he can enter the persons profession/description.
My goal is, that in the fluid template I can add a line where the selected news type will be added as a class to the list item, something like:
<div class="news-item {newsItem.type}">
// some code
</div>
will render out as:
<div class="news-item interview">
// some code
<div>
I'm not quite sure what I have to add to my custom extension that I'm using to accomplish that.
I appreciate all the help.
you need to extend the news data with further fields. This is described in the manual and this blog(ext:news is extended, but filestructure is old) and this article(current fielstructure, but other tabel is enhanced).
For the evaluation and displaying of your fields you need to modify the templates of ext:news. copy the neccessary parts into your extension and provide the modifications to it.
Also set the typoscript to include your templates like described in the manual.
I have three simple html or php file that I'm going to create.
What will be include in there is that a content such as video's name or let say a person name
in total it will be almost 2000 of them
but I will split it to three different pages or maybe I will make it one page with different categories.
now my question is that how will I make a search form that can be search from a different page while they are still on the page index
this is what I'm currently using <div class="searchbox"><form action="index.php" method="post"> <input type="text" name="q" value="">
this search form is a live time search result
but I will it to be able to search from other page as well or from a different categories
but where should I put the tag or anything to the content in order to get the search show the result.
I guess something like that could be done with javascript but it isn't really my forte. But one issue with this is the other pages don't really exist on the users browser until they have browsed them so you might have to download a bunch of pages in the background. Doesn't sound like a great solution to me.
I'd recommend doing searches on the server side where you have the data, rather than trying to parse rendered html on the users machine. And then send the results to the user.
So I am working on Joomla 1.5 and retro fitting an existing website to work with this CMS. I've got most of the templates down and I have created Modules for Side navigation on the internal pages. However, on the original website, php in clauses are used to change the class of the link to show the current page the visitor was on (e.g
<a <?php if ($page=="career_opportunities") echo "class=\"currentpage\""; ?> href="?page=career_opportunities">Career Opportunities</a><br/>
<a <?php if ($page=="locations") echo "class=\"currentpage\""; ?> href="?page=locations">Practice Locations</a>
</div>
is it possible for me to maintain this structure in the new side navigation menu I created in joomla? Do I have to make it HTML customized type Module? Do I need to find a way to capture the current page's ID? Where should I begin?
Thank you in advance
You can do it by using css also which will be much easy for you to handle this using css.
I'm creating a UX experience that will allow the user to add items to a collection by using a jQuery button, and some AJAX.
My problem is, when the user finishes adding items and filling out the rest of the form, they complete the form, which I want to carry up to the server in the form of a strongly typed class.
My question is, what is the best approach for adding a new item to a Model's collection using jQuery and Ajax? or is this at all possible?
Example:
<li>
<div id="shipment">
<%: Html.EditorFor(x => x.Shipment) %>
</div>
</li>
x.Shipment is actually a collection inside my Model.
I have buttons in the EditorFor that let the user add items to the shipment.
Then, when the user posts the form, I have the controller set up like so:
[HttpPost]
public ActionResult CompleteReceipt(Receipt receipt)
{
Context.Update(receipt);
return RedirectToAction("Index", "Home");
}
What is the best practice or way for using jQuery to add items to my Receipt Model's Shipment collection?
Checkout this excellent blog post from Steve Sanderson. It provides a nice overview of how to achieve what you are looking for and could be considered as best practice. Don't forget to read the follow-up which is about validation if you are interested in this aspect as it could be a bit challenging with dynamic forms.