There are a bunch of question on this but no answers on how to do it without javascript.
If you have one form that has 2 select boxes. The second select box has different options based on what you choose for the first select box. Here is a js example. Not all users have js enabled so for these users this option would be unavailable.
Can this be achieved solely using CSS3, HTML5 and Ruby? I would show what I've got so far in trying this but I got nothing.
What you are asking is how to manipulate the DOM after it has loaded without a client-side scripting language. This is not possible as far as I am aware; unfortunately that is not what you want to hear.
The proper solution in this case would be to have the user submit the page and generate the second selection box at that time. You will have to rely entirely on server-side logic to handle the problem. So basically something like:
Serve a page with just a single selection box
When the page is posted generate a similar page where the first selection is locked and display a second selection box with the possible options.
Continue the iteration until you have all of the required selections filled out by the user.
Serve the result that the user requested.
I have a form that is very long but is submitted and validated all together. I need to break it up into sections.
I have tried using the Trinidad component panelAccordion to break the form into sections.
However if I then submit and validate the form, clicking one of the panels open or closed causes the validation messages to disappear.
Is there any way to avoid this?
Or is there a better way to achieve the same result of breaking up the form?
I am using Trinidad 1.2.6 and MyFaces 2.0.
Due to corporate standards I cannot use anything else.
One way you can achieve the desired effect is by submitting the form when a user clicks on each <tr:accordionPanel>. It supports many other client side events so pick one that best suits your needs.If you submit the entire form, this will force validation to kick in for all components however, whether the user entered a value or not. This might be the quickest and simplest way but some people might be picky and not like this solution.
You can also make use of partial updates and partial triggers and submit only the components that are part of the current accordion panel based on the event you choose.
I have quite a big application, sometimes with pretty complicate data being created by the user (on the way to the database the data is being altered a lot). The issue is, that any time I need to alter the code, I get stuck for quite a few hours before finding the problem.
Actions in my app:
User opens the jquery modal dialog
There is a form in the modal dialog
User alerts the data and saves it
About app:
The application contains of one site with a table and several buttons
Each of these buttons open a different modal dialog
Each form submission is handled via ajax -> cakephps this->js->submit
How I wrote the code:
For each modal dialog I created an element
After clicking the button I open the element as a jquery modal dialog
Lots of these modals gain information via for example: "On click/on double click etc" events.
My problem:
Every time I alter the cakephp code which is called by $this->Js->submit I feel like putting a gun to my face and pulling the trigger.
I dont know of any easy way of how to debug variables in these functions (cakephps debug doesnt show anything ofc -> the view of those ajax/php functions are not in the main site)
Dont know if firebug has any features for debugging php, but I dont know of any.
The only thing that works for me a bit is commenting out lines of code and putting an alert in the success like this to maybe sometimes get to the values, but it doesnt feel right.
Being used to write code in c++/java and printing or debugging with breakpoints makes me frustrated, when I use such a modern programming language and try to guess out where the bugs might be..
Most errors:
Mostly null pointers or checking !isset index being accessed, but since I know of no way of printing these errors from modals no checking on the indexes helps me.
Use FirePHP it is a great enhancment of firebug. Works well.
I'm building a web site (using ASP.NET, MVC 3, Razor) and I'm not using an off the shelf CMS. This is because I evaluated a lot of existing CMS's, and found them all to have a massive learning curve, tons of features I didn't need, and they force you into a page oriented model. By "page oriented model", I mean that you can specify a general page layout and stylesheets, but the object that the user can edit is a whole page, which displays, for example, in a central panel, and maybe you can customize the sidebars as well.
But this site is very design centric, and needs to be much more fluid and granular than this. By "design-centric", I mean that the site was built in Photoshop by a graphic designer, and there is heavy use of images and complex styling to map the design to HTML/css/js. Also, every page on the site is totally different. There are also UI elements such as accordion panels, in which we need the user to be able to edit the content of each panel, but certainly not the jQuery+HTML that powers the accordion. The users are subject matter experts but very non-technical.
So I'll have a page with lots of complex layout and styling, which I don't want the user to access, but within this there will be, say, a div containing text that I would like the user to be able to edit.
How can I best accomplish this?
So far, I'm implementing this by having snippets, which are little units of html, stored in external files, that the user can edit. In run mode, these are loaded and displayed inline (with a little "Edit This Content" button if you're logged in and have permissions). If you click the Edit button, you get a little WYSIWYG editing screen, where you can edit and save changes. So I can control all the messy stuff, and put in little placeholders for user editable content. But this isn't entirely simple for me, and I'm wondering if there's a better way.
Don't mean to necro this, but it seems to be the most relevant question to what I'm currently researching. I recently built something similar as you described above, but I'm pulling data from a database instead of static files. For each page (like /about or /contact) in the Controller I pull data for that page from the DB in the form of a Json string key/value pair. Key is the placeholder tag, Value is the.. value. After deserializing, I simply populate a list and assign it to a ViewBag, then in the CSHTML I ViewBag.List.Keyname to grab the text.
I have a small admin control panel which allows me to modify the text in the database. Having little hover-overs like you do is a great idea though!
Well, I stuck with my original plan:
So far, I'm implementing this by having snippets, which are little
units of html, stored in external files, that the user can edit. In
run mode, these are loaded and displayed inline (with a little "Edit
This Content" button if you're logged in and have permissions). If you
click the Edit button, you get a little WYSIWYG editing screen, where
you can edit and save changes. So I can control all the messy stuff,
and put in little placeholders for user editable content. But this
isn't entirely simple for me, and I'm wondering if there's a better
way.
It works reasonably well for now.
I am trying to show/load different editor on different rows of a editorgridpanel. Like a textbox on one row combobox/superboxselect on another and it could be any order, random.
The conditions which dictate which editor will be shown reside in the database.
Please tell me if this is possible and if so, how do i go about it.. I have tried pulling the conditions asynchronously which are pulled on a click event for the respective column, but calling it async causes problems. Please advise
Anything is possible, but what you want to do would take a bit of work. The basic idea would be to configure the needed grid editor(s) dynamically and update the columns with the new editors when needed. Now... what would be required to make that actually work I couldn't say offhand without digging into the Ext source -- it would almost definitely require overriding default behavior in the grid and/or column model.
Pulling your conditions asynchronously would (I imagine) be too slow for the interaction of clicking on a row to edit inline. If it takes a second or more from click to configured editors, that would not be acceptable performance. I would try to find a way to send your conditions down along with the other row data if at all possible (they can be in the store's data model on the client without having to be shown in the grid).
Without knowing more about your business requirements, it might be more appropriate to ditch the editable grid and instead go with a dynamically-configured FormPanel tied to the grid. This way the interaction of clicking and then pausing slightly while the form is configured would appear to be more natural. Also, the functionality of rendering a form with a particular configuration is perfectly standard and would require nothing fancy on your end. See this example as a starting point (your form would be dynamic, but maybe the same type of interaction could work?)