Is there any way to show/hide page in the odoo form when button is clicked ?
There is a page in my contact form I want to hide or show based on button click.
I don't want to use attribute method or any xpath.
Just click button page show up and click that button again it will hide.
Does JS can be written in Odoo form for this process?
It's doable but I don't think it's a good approach, you can make a click event that will trigger toggle to hide/show the notebook. But in your case, I would recommend that you do it through security if you want to show/hide the notebook for specific users.
Related
The reason for this to cover any user that MAY have javascript turned off. It's a company standard that we develop our web pages for this, since our demographic still have their VCR's blinking 12:00.
I have a text link that is being populated by a database call:
Click for Article
The common user experience is that the user will click the link, and it will toggle a modal displaying the article. BUT we want to incorporate a fallback in case the user has javascript turned off, so when the link is clicked, it will simply take the user to the article page and display the dynamic content loaded by padding the Article ID of 123.
Currently with Bootstrap properly loaded on the page, when the user clickson the link, it just goes to the article page and does NOT toggle the modal.
What method do I need to add to a onClick event to prevent this click through from occuring, but still toggling the modal to display?
$('[data-toggle="modal"]').on('click', function(e){
e.stopPropagation();
});
or
$('[data-toggle="modal"]').on('click', function(e){
e.preventDefault();
});
The correct answer is e.preventDefault()
I want to create a form with multiple radiobuttons/checkboxes and direct the user to a certain page according to the selection when the user has clicked on submit.
Example of what i'm trying to achieve
You do not select a button, you tick a checkbox. If that checkbox happens to look like a button, that is already css business, not js.
You can take a look here at how this could be done.
I have added a button via workflow and I need to redirect it to another location/link(say .. www.google.com link). How can I achive this, Since button's id cannot be changed in workflow, I could not append any Javascript function in that button . Also Action in workflow does not have an option to set link to Workflow buttons,.
Does this mean Workflow buttons can only be made to move to another State?
Note: I know to add buttons via user script but for this particular scenario I want to achive this only with workflow button.
The only way to handle button clicks in workflows is to create a transition to another state. Within the transition, there is a drop-down field called Button that lets you choose which button would fire the transition.
You can only cause a workflow to navigate to either a record using the Go To Record action, or a task link using the Go To Page action. But I'm not sure if you could navigate to a link using workflows as you've mentioned above.
Why not add a button and hijack it via a client script? Just add a call on the form of client side to find the button element on the DOM and change the properties. This can be easily done with jQuery, which comes by default on NetSuite.
I am using on click method onclick example am using
I am using two step Onclick method when I click 2nd Onclick a HTML form should open in same page how do I do that
since I am using many sub categories Like ,mobile, computer, etc,...
so I have many sub form
when user click sub form the linked form should open in same page here is the working example Onclick method
what I need is how to open html form file below
You could do something like this: http://jsfiddle.net/8ugjj2yo/2/
In short: bind click events on each 1:st menu item, and then on 2:nd menu item.
Each click handler should close "all other" of the same kind when you click it, then open whatever you clicked (if you want more forms to be displayed at the same time, remove all rows that call
.hide();
The css supplied in the fiddle is just temporary, change it to whatever, the only thing you can't change is the
display:none;
thats there already. (You could also hide them on page load with jquery ofc..)
I wonder if there is a way to create some checkboxes into a dialog (such as confirm or alert) with no intervention of HTML code, I mean, create a dialog with YES and NO buttons and checkboxes only with Javascript, which appears clicking a link.
Thanks.
Example:
http://i.stack.imgur.com/7VnOW.png
EDIT
The result would show:
a dialog with buttons (OK, CANCEL), and various checkboxes
user cannot select more than 5 checkboxes, but at least one
once user select options and click OK, will send text strings corresponding to checkboxes selected. Example: "check1|check4|check7".
You can achieve this by using an external library such as Jquery UI or even Twitter Bootstrap. You can create a modal dialog and embed every input type you want in it. Take a look to the JQuery UI docs, it might help. http://jqueryui.com/dialog/