Open a popup based on dropdown selection in Acrobat - javascript

I have created a drop-down in my PDF form and would like to open a popup window based on the option selected in the drop-down.
The dropdown is as follows -
Level 1
Level 2
Level 3
Level 4
Please note that I have selected the Commit selected value immediately option.
I would like to trigger a popup when the user selects Level 3. Below is my code -
var v = this.getField("Name of the field").value;
if (v === "Level 3") {
app.alert("Hello world!!!", 3);
}
Now the code works but there is an issue. When I click on Level 3 nothing happens. But when I click any other option after clicking Level 3 the popup appears. I am unable to understand what's happening here. Please help

Related

Radio button on Wix dynamic page

I am currently working on a dynamic page setup on my site which involves radio buttons. There are 4 radio buttons with each one linking to a different dynamic page and I have added the below code to change the url to match the relevant selection
export function radioGroup1_change() {
const label = $w('#radioGroup1').value
let url = wixLocation.to(`/dynamic-page/${label}`);
}
(Nearly) everything works fine - the pages change according to the selection made in the radio buttons and the url follows suit. However, the page is set up to load onto 'Page 1' of the dynamic page and on loading the radio button for Page 1 is highlighted to indicate we are on that page. When i click on 'Page 2' (as an example) on the radio buttons, everything changes correctly but the radio button reverts to highlighting 'Page 1' instead of staying highlighted on 'Page 2'.
Is there something missing from this code which I need to add to correct this please as I have scoured this forum but not been able to find any answers unfortunately?
Thanks
You can use a if/else statement to change the selected value of the Radio Button Group using the selectedIndex function. Put the code under the page's onReady() function and use Wix Location's Path function to check which page you are on.

Wordpress - Drop Down Menu auto select using button

Hey guys I'm wondering if the below is possible in WordPress based on the scenario, also these are the plugins I'm using Contact Form 7 and Contact Form 7 Conditional Fields:
I have 3 pages:-
Page A which has a list of products.
Page B which is a single product that would've been clicked on from Page A and also has a button that leads to Page C.
Page C which is basically a contact page with 2 conditional field groups where the user can either select "General Question" or "Product Inquiry". After one of the two options is selected, a set of fields will appear respective to the option selected. When the "Product Inquiry" in particular is selected, another drop-down list will appear which has the list of products in which the user will choose which product they're inquiring about.
So what I want to know is if there is a way that when the user clicks on the button from Page B and it then goes to Page C, how can it automatically choose the "Product Inquiry" drop-down option and then select the same product from which they came on the list of products drop-down that has now appeared? I want to lessen the manual work for the user.
I'm thinking maybe the button could work like some sort of accordion select where you just set the #id of the accordion you want to open in the hyperlink/url.
Any thoughts would be great, thanks.
You can set a $_GET. Let's say you have products: "Ball", "Bat", and "Gloves". Here's an example:
<button>Click here for ball</button>
<button>Click here for bat</button>
<button>Click here for gloves</button>
Then in your Contact Form 7 form settings, you would have something like this:
[select* menu-10 default:get "Ball" "Bat" "Gloves"]
You would obviously change menu-10 to whatever your menu ID is.

oracle apex trigger mouse click over region using jquery

I have 3 regions in my apex page. R1,R2 and R3. R1 is a tabular region. R2 and R3 are sub regions of R1. I want to trigger a fake mouse click event on region R3 when a button is clicked, using javascript. so to trigger mouse click on region R3 ( static id: R3 ) I used the code
$('#R3').trigger("click");
But that doesn't work. When I inspected the page, I found the region id as 'SR_R3_tab'. So I changed the code to
$('#SR_R3_tab').trigger("click");
That didn't made any progress . How can I do this ?
Not sure what APEX version you are using. But I tried to reproduce your flow here.
What I basically did:
Parent child has a button 'Trigger Click'
Added dynamic action on click on that button, where the action is execute javascript: $('#R35171256286597705402').trigger("click");
List item R35171256286597705402 is the id of the child region. Not sure why yours is not following this format, because usually APEX generates these ids. But I fetched from inspecting
To validate, I added another dynamic action, but this time on click on the child region. It basically displays the alert

Javascript Use a previous drop down box to justify the next one

I am looking for a solution for my website. I have a form where a customer selects their device (eg iPhone 6s, Samsung GS6), but I would then like the data from that drop down box to transfer over to the next drop down box so they can select an available repair. If you need an example, go to my website (www.warerepair.uk/booking.html)
Looks like you want cascading drop-down then in that case you have to on first drop-down change event get first's drop-down selected value and using that value load second drop down.
Please see the below code
$('#firstDropdownID').on('change', function () {
var searchVal = ($(this).find('option:selected').val());
//Using this searchval load your second dropdown
});

I want a more efficient way of coding to not display buttons

I have two grids, they both display buttons. One grid displays numbers, true or false and yes or no, and the other grid displays letters, true, false, yes and no.
The second grid is not displayed in the code (used css to not display second grid buttons (.answerBtns)) Now using the getButtons() function, if the user selects button "1" in first grid (the grid which you have to open using (Open Grid) link, then it should display button "A" in second grid, if user selects button "2" in first grid, then it should displays buttons "A" and "B" in second grid, if "3" then display "A", "B" and "C" and so on.
Now except using if statements and stating which buttons should be displayed and not displayed depending on the button chosen in first grid, is there a more efficent way of coding this so that the display of buttons in second grid depends on what is selected in the first grid?
If it is using an array can somebody show a sample of this in their answer. You can just do it for one example and then I should be able to use that to fill it for the other buttons.
Thank you
Code is in jsfiddle, click here
So say someone clicked "4", then you could find the "answerBtns" and iterate through the first four using jQuery.each(). I believe jQuery will find the buttons in the order they appear in the DOM.
var clickedNumber = 4;
$('.answerBtns').each(function (index) {
if (index < clickedNumber) {
$(this).show();
}
});
I think I'm addressing what you're asking, but not sure.

Categories

Resources