Open html form below home page Onclick - javascript

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..)

Related

Oracle APEX - Put onclick event on tabs of tabs container

I've got a tabs container with three tabs. They have select lists and checkboxes on them which have sql queries as source. Users can select entries in the lists or edit the checked boxes and save this to the database by clicking a button. This button also re-fills the select lists and checkboxes with the current data from the database after saving it.
My problem is: When a user selects an entry in a select list or edits a check box and navigates to antoher tab without clicking on the "save" button, the data stays there when navigating back to the tab. I want to assure that what is depicted in the lists and check boxes is always the current data like it is in the tables in the database.
Therefore, I tried to put an onclick event on the tabs of the tabscontainer like this one:
I didn't get it to work, becuase these elements do not have an ID and I can not set an ID for them in APEX (at least I guess so). Is there a way to do this in APEX anyway?
This is one of the tab elements:
You can put a static ID to your tab region (for example #SOME_STATIC_ID) and then select the elements with a jQuery selector:
$("#SOME_STATIC_ID a.t-Tabs-link")
You could also define an on click listener on text of the tab:
$(".t-Tabs-label:contains('Tab 1')").click(function(){alert('Doing something on click of Tab 1 !!!')});
It might not be the cleanest solution but it works.
Just in case anyone else is experiencing the same problem: I solved it by putting an custom dynamic action on the tabs container:
This fires whenever the user switches between the tabs and ehrefore worked for me :-)
For more information check this article: https://medium.com/#pierre.yotti/tabs-region-javascript-api-in-oracle-apex-37e20bc9f68f

Button on accordion (bootstrap)

I'm creating several accordions headers and bodies from a vuejs data object.
The header is a button that triggers the body content and contains several datas and 2 nested buttons.
1st one to delete current header and its body from the DOM
2nd one to edit the body.
Second button is supposed to open a modal but for some reason when i click on this modal button, it triggers the accordion's collapse and modal at the same time creating a visual bug.
How can I trigger a nested button without triggering the main button?
I would have to see your code to tell your for sure, but it sounds like you can just use a different on click event for the second button?

Show or hide notebook page in Odoo?

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.

jQuery on click event not working on a button but works well on other links

So I've got a cart drawer on my e-commerce site that I want to get to open on click whenever the 'Add To Cart' button is clicked.
I can't comment yet, however, i think your button may not be firing because of duplicate id fields.id's are considered unique to one element while class's can be applied across many elements. Your javascript ('#AddToCart') will only run on the first element with that specific id. Check your code just to be sure.

Onclick not working in panel after page change

I'm creating a small webapp using jquery mobile and php. I have an issue where I have a menu in a panel which i need to run an onclick event from. This works fine when the page has been re-loaded either using data-ajax='false' or running a page refresh. However when I try to use the event after a page change it just doesn't respond at all.
Here is my onclick code
$('#searchOptionMap').click(function()
{
window.alert("map clicked ");
});
and you can see the js fiddle here http://jsfiddle.net/jbcvnz0p/
If you go to page 1 - panel click - map click the alert appears
If you then navigate to page 2 - panel click - map click the alert doesn't appear
If you stay on page 2 and click the map collapsible - alert appears
You can see that the same onclick event works for a collapsible set outside the panel, just not within it. Is there any fix for this other than using data-ajax='false' or running a page refresh?
You have two divs with the same id, when you bind something with jQuery using an id, it only does the first one.
$('#searchOptionMap').click(function()
{
window.alert("map clicked");
});
So use a class instead, or make the panel external if it's going to be the same panel for both pages.
(#searchOptionMap2 works in this case because there's only one of them)

Categories

Resources