0
Please, I’m trying to make a combobox visible within a page.
I am using Internet Explorer with "F12" (Developer Tools) TAB "Console" triggering command on the command line below.
For this Combobox to be visible you need another Combo to have a Specific value.
Example: "Current Account"
<div class="ui-widget ui-combobox ui-required mode-edit" id="cd_liquid" style="left: 144px; top: 156px;" data-widget="combobox" data-block="COT_MOVIM_ED" data-member="CD_LIQUIDA" data-action="selectionChanged" data-name="cd_liquid">
<select name="cd_liquid" class="ui-widget-content ui-corner-all" id="#cd_liquid" style="width: 184px; height: 16px; display: none;">
<option value="CE">Conta Estrangeira</option>
<option value="CC">Conta Corrente</option>
<option value="CP">Conta Poupança</option>
</select>
<input class="ui-autocomplete-input ui-widget-content ui-corner-left" id="pdcme_liquid" style="width: 168px; height: 16px;" type="text" value="" />
<button tabIndex="-1" class="ui-button ui-widget ui-state-default ui-button-icon-only ui-corner-right ui-button-icon" role="button" aria-disabled="false" style="left: 168px; width: 16px; height: 16px;" type="button">
<span class="ui-button-icon-primary ui-icon ui-icon-triangle-1-s"></span><span class="ui-button-text"> </span>
</button>
<label style="left: auto; width: 141px; right: 0px;" for="pdcme_liquid">Forma Liquidação</label>
</div>
I’m trying to do it like this:
1º) IT WORKS -> A ". val" puts the 'Current Account' value inside the combo, thus:
$('#pdcme_liquid').val('Conta Corrente')
2º) PROBLEM IS HERE -> With the value already placed inside, now I need Javascript to "understand" this and trigger an event to make visible the other Combobox. I’ve tried that:
$('#pdcme_liquid').change()
$('#pdcme_liquid').click()
$('#pdcme_liquid').contextmenu()
$('#pdcme_liquid').focus()
$('#pdcme_liquid').focusin()
$('#pdcme_liquid').focusout()
$('#pdcme_liquid').keydown()
$('#pdcme_liquid').keypress()
$('#pdcme_liquid').keyup()
$('#pdcme_liquid').load()
$('#pdcme_liquid').mousedown()
$('#pdcme_liquid').mouseenter()
$('#pdcme_liquid').ready()
$('#pdcme_liquid').select()
$('#pdcme_liquid').submit()
$('#pdcme_liquid').trigger()
$('#pdcme_liquid').triggerHandler()
I’m trying on the INPUT object, but I don’t know if I should fire an event on SELECT or BUTTON?!?
OR I should select the value of the select "CC" item and then trigger an event for the internal javascript to display the next combobox?!?
Post all the code please, your HTML is missing A lot, there is no tag properly closed and this is all giving errors in the tests. Please, edit your post and post the rest of the code.
– Jakson Fischer
#Jakson_fischer, okay, corrected.
– FabioIn
One thing... I put your code in the fiddle to do the tests, when it starts, it’s starting with a text box only. Shouldn’t you start your combo with select? Here’s how it’s starting: Fiddle Example
– Jakson Fischer
#Jakson_fischer, what an interesting site the fiddle, did not know. But the fiddle didn’t recognize the DIV as a Combobox... did he miss JSON 1.7 or something?!?
– FabioIn
Do you use any
CSS
orJS
in hisheader
? If yes, put in your question this header also that I put in Fiddle, so it will recognize– Jakson Fischer
#Jakson_fischer, there is some place that has a tutorial on "jsfiddle.net", I’m trying to create my account, but even this I’m getting! KKKKK!
– FabioIn
Create in this link
– Jakson Fischer
#Jakson_fischer, you must have a lot of Js, but unfortunately I don’t have access to the source code. I need to do an event trigger to work within a Web Crawler (Web Scraping) from a Windows Form with Geckofx that I am developing. I am currently using "mouse_event" and "Sendkey" ... this 'locks' the mouse for the user, the machine becomes unavailable for the user to use other applications (at the same time).
– FabioIn
#Jakson_fischer, thanks for the link.
– FabioIn
I understand... unfortunately I don’t think I can help you, but I’m looking for a solution, if I find it, I warn you
– Jakson Fischer
Have you tried that:
$('#pdcme_liquid').val('Conta Corrente').change()
? But it is necessary that on the page there is the code to listen to the event change:$('#pdcme_liquid').change(function(){
 $("#cd_liquid").show();
});
... only that you are using two equal id’s in div and input, and the input is incorrect id:id="#cd_liquid"
... id cannot start with#
...– Sam
Valew #Jakson_fischer!
– FabioIn
@Sam, ". val" assigns the value, but ". change" has no effect...
– FabioIn
It will only take effect if the page has the code I mentioned above and if you correct the id’s mentioned.
– Sam
#Sam, so... this is my dilemma as I DO NOT have access to the HTML source code. I’m making Web Crawler (Web Scraping) to program a Windows Form with Geckofx...
– FabioIn
So you have to run everything on the console:
$('#pdcme_liquid').change(function(){
 $("[name=cd_liquid]").show();
}).val('Conta Corrente').change()
– Sam
#Sam, amazing that the ". val(" works, but does not trigger the hidden Javascript that puts the next "combobox" as "Visible"...
– FabioIn
Here it worked smoothly.
– Sam