calculation with select option value using javascript - select

I have query related to javascript that we call a function where is id in select option tag. So can we use this id for calculation in other function? how to get this id? If yes then how? If no then please give me some other idea..
How to read this id?
Give me result soon.

Use .val(), see this jsfiddle example. Here i'm using .change() you probably want to use .submit for this.

Related

Navigate to tab passing parameter

Is posibble to pass parameter with this method:
this.app.getRootNav().getActiveChildNav().select(3);
i tried:
this.app.getRootNav().getActiveChildNav().select(3, {apto: 1});
but it didnt work.
No, according to the docs the select function only takes one parameter (tabOrIndex) specifying the tab or index to select. A quick look into the corresponding code verifies this.
To work arround this and pass data from one tab to another you can refer to this answer which offers three possible approaches to this problem.

Find and take value of href using protractor

enter image description here
I had search and read many guides but it doesnot work. Could someone please help me? I want to get the href value like in the image. Thanks for reading my post.
You can use getAttribute() method to get the value of any property available in the webelement. In your case you need to find the respective element and can use below code to get the href value,
element(by.css("a")).getAttribute("href").then(function(hrefValue){
console.log("href value",hrefValue);
})

How to create a Smart Field control with ValueHelp feld

I need to implement a Smart Field control with Value Help in my form. I am getting json response from ODATA service. And I am setting it to a JSONModel. I have tried a sample code refering this link but I don't know how to bindElement. Please refer this JsBin
SmartControls rely on OData! However, you are using a JSONModel! Also, as #matbtt mentioned you are binding a single field to an array, but you should do it the way he mentioned above... This jsbin is the correction but still only with a JSONModel instead of an ODataModel. And this one uses OData and works just fine.
Is there a specific reason why you call an OData Service and wrap the response into a JSONModel? Do you know how to use the ODataModel in UI5?
And thank you for using my single file template!
As your data are contained in a named array you need adjust the binding as follows:
<smartField:SmartField value="{/TableCollection/0/AccountNo}" id="companyCode"/>

Access select using div/span id

In jquery is it possible to access a select element by simply using the div or span id plus the "select" selector? I ask because i have a series of auto-generated forms meaning I can't assign an id to the form elements plus the names are weird like "w24", I'd like to access a form element specifically a select using the surrounding span id and "select" selector example:
$("#hiv_care select").attr("disabled",true);
I've tried this but it doesn't work, forcing me to explicitly use the dropdown name.
Seems I was using the wrong div id. SLaks thanks for the link to jsfiddle.net it exposed my ways and is really helping me with testing out my jquery code.

I'm trying to select the adjacent sibling of "this" in jquery

$(this+"p").slideDown("slow");
$(this)+$("p").slideDown("slow");
$("this+p").slideDown("slow");
does not work.
Yeah, your syntax is bad. You should use the jQuery Sibling function:
$(this).siblings().find("p").slideDown("slow");
The jQuery API site is awesome for looking stuff like this up, I rely on it nearly daily. I'd keep an eye on it.
Next.
$(this).next("p").slideDown("slow")
Make sure that the "p" element is directly adjacent, though. Otherwise you'll want to use nextAll.
jQuery have not seemed to apply this? Possibly the syntax we are trying to use is incorrect.
next() can only select elements with an ID or Class - Not just a naked dom element as expected.
Instead use. > means select first level decends only.
$('body > div').hide();
But this gives the exact same result
$('body').children('div').hide();
But,
Next
$('body + div').hide();
and
Previous
$('body ~ div').hide();
Do not seem to work as expected? But jQuery use it as example for CSS selection...
Possibly there is a complex syntax to achieve this but I could not figure it out...