Connecting a dictionary and datalist - dictionary

I am trying to make a stock trading webapp using ASP.Net Core MVC One of the things I am trying to implement is auto-complete search box where you can type the name of a stock and it would be suggested to the user. I tried to use a datalist. I want to use a dictionary where the name of the stock is the key and the value would be the symbol. example key- Apple value-AAPL. When the name is selected, I am trying to use the symbol to call other data from an API elsewhere in the app.
The 2 things I am trying to figure out is
A. Can I implement a dictionary with a datalist to accomplish this?
B. Is there a way to use a database to accomplish this? There are several thousand Stocks and Stock symbols and hard coding them would be very cumbersome and time consuming and would be easier to copy and paste stock names and corresponding symbols into a database.
Thanks in advance. This is my first time posting.
Here is what I have so far. Not sure how to proceed or if this is possible.
<form>
<label for="stock">Choose a Stock:</label>
<input list="stock" name="stock" id="stock">
<datalist id="stock">
<option value="Tesla"/>
<option value="IBM"/>
<option value="Microsoft"/>
<option value="Apple"/>
<option value="Amazon"/>
</datalist>
<input type="submit">
</form>

Related

Set Different Amounts for Different Currencies in Flutterwave

Hi I am using the flutterwave api gateway to create a payment form which will have different preset amounts in different currencies. for example
USD -10
KES-100
UGX-1000
My thoughts were to put a select box and you choose the currency and then enter your details and press pay.
Would This be possible in asp.net ? Anyone done something close to this? How to pass the values to the api?
Its Posible...
I have a working
prototype... of sorts.
I created the values in a select box and made the currency and amounts separately. Then pooled the values and passed them to the api with the preset values currency and amount. The flutterwave api gets this info and serves up the right payment method for that particular currency.
<form method="POST" class="payment-form-africa" action="https://checkout.flutterwave.com/v3/hosted/pay">
<input name="customer[email]" asp-for="email" />
<input name="customer[name]" asp-for="name"/>
<input name="tx_ref" asp-for="tx_ref"/>
<input name="amount" asp-for="amount"/>
<input name="currency" asp-for="currency"/>
<button type="submit">Pay</button>
Thanks everyone.

ERR-1002 Unable to find item ID for item in multiple options select

I have a multiple option select and everytime i submit the page i get:
ERR-1002 Unable to find item ID for item "clients1" in application
for day in {something}
htp.p('<select class="custom-select" name="clients'||to_char(day+1)||'" id="clients'||to_char(day+1)||'" multiple>
<option selected>Open this select menu</option>');
for client in (SELECT id, name FROM client) loop
htp.p('<option value="'|| client.id ||'">'|| client.name ||'</option>');
end loop;
htp.p('</select></div></div></div>');
Looks like this :
<select class="custom-select" name="clients1" id="clients1" multiple=""><option selected="">Open this select menu</option>
<option value="1">Test</option>
...
</select>
I really can't find the problem. Tried to search for an answer but could not find anything.
Thanks in advance
APEX assumes that a form element such as a select list is an APEX page item if its name and id are the same, which yours are. So you can avoid this problem by making the names different from the IDs in some way.
The usual way to create bespoke form elements on an APEX page is to use the APEX_ITEM package, which has functions like SELECT_LIST_FROM_QUERY to generate form elements whose values can be accessed from PL/SQL after page submit via APEX_APPLICATION arrays.

Visual Studio 2015 Extraction Rule Issue

I am attempting to create a performance test to capture login and order status from my site. The recording is simply a login page and click a radio button to populate some data. So on initial record with one user, the test works fine. However, when I add a data source with multiple users, I get a postback error on the last page which populates my results. My details just say
500 internal server error
I have a parameter called UnitMemberList which contains the results from the radio button. The response looks like this:
<select name="Ti2$P$content$content$unitMemberList" id="Ti2_P_content_content_unitMemberList" style="width:350px;">
<option value="23505183">100690 - Paula</option>
<option value="10008483633">L76753 - VICTORIA</option>
<option value="10001974885">F55115 - Esther</option>
<option value="10008313924">K86743 - LUCIA</option>
<option value="10007718454">I68327 - GUADALUPE</option>
<option value="10009940400">U99948 - MARIA SONIA</option>
<option value="10008115322">K17051 - MARICELA</option>
<option value="10009928413">U95563 - DANIELA</option>
<option value="10010367156">W65214 - MACRINA</option>
<option value="10000893346">A78549 - Erendira</option>
<option value="10007569390">I13064 - MARIANA</option>
<option value="10001326244">C70591 - Lidia</option>
</select>
Is there a way to just capture the contents of the option values? Everything from option to /option? I can't extract by option value= as there are several of these throughout the response. Also, on the first run, the captured content is just the first number 23505183 and that is stored for the parameter UnitMemberList.
I figured it out. I had more than one match from my response. I changed my regex to use a digit match instead of character.

Selenium IDE : how to verify that only specific values are present in a drop down list

I hope someone is able to help me. I am trying to determine whether or not Selenium IDE can verify that only specific values are present in a drop down list, and should anything else appear within the drop down list it is an error.
For example, using a basic html Single Select drop down list :
<select id="drop_down_list">
<option value="Test">Please select...</option>
<option value="Saab">Saab</option>
<option value="Mercedes">Mercedes</option>
<option value="Audi">Audi</option>
</select>
I know I can verify the 'Label' of each selectable value using (for example) :
verifySelectedLabel : //select[#id='drop_down_list'] : Please select...
I know I can verify the 'Value' of each selectable value using (for example):
verifySelectedValue : //select[#id='drop_down_list'] : Test
And I know I can do this for each other selectable value displayed.
But what if for whatever crazy scenario, a Dev decided to add 'Ford' to the drop down list, and he/she did not make anyone aware of this ? My tests would pass as those selectable values which I am expecting are still present.
Is there is a way of verifying that no other values other than those I am expecting are also contained within the drop down list ?
I know there is 'verifyNotSelectedLabel' and 'verifyNotSelectedValue' available for use, and these work perfectly when I can specify the 'Labels' and 'Values' accordingly, but they dont help in this particular scenario.
Fingers crossed someone can help, many thanks in advance to all,
How about using "verifySelectOptions", this will check all the options in the dropdown exactly how it should appear.
So in case if there is a New value added or some changes in the existing values (like spelling mistake etc) Step will fail.
If you right click on the dropdown list while in Selenium-IDE, try choosing verifyTextPresent from the command list. The value will be a text list of all the options in the list strung together(usually with spaces between).
Then if a developer adds a selection(or misspells an existing selection, the step will fail(you could use assertTextPresent if you want the test to stop at that point).
Klendathu

Asp.Net, Dynamic Data Website, Foreign key One to One relationship, DropdownList, how to customise?

I'm using Asp.Net's Dynamic Data Website project type.
I've created a db that has one to onerelationship between two tables specified using a foreign key, (this could be one to many but I've used the linq designer to change it to a one to one relationship).
i.e. I have a table Invoice and table CreditNote that takes an Invoice_Id as a foreign key
I was hoping that when I navigated to CreditNotes/Insert.aspx that it would display the a list of InvoiceIds in a dropdown list. It almost does this - it creates dropdownlist but only populates option value and not the text so I get something like this in the html source (notice only the value is populated - which looks empty to the user):
<select>
<option value="someInvoiceId"></option>
<option value="someInvoiceId"></option>
</select>
Can anyone tell me how I could fix this?
Thanks in advance for any help!
Hey I just stumbled over this question look for another answer but I think that you might need to set up some more meta data on your model such as the adding attributes so that you can define which field should be used
http://ericphan.info/blog/2009/2/24/aspnet-dynamic-data-display-custom-text-in-a-foreign-key-dro.html

Resources