Call HTML.Partial with button ASP.NET MVC - javascript

From a view I would like to know if with a button can call a #Html.Partial when I click using onClick() instead to have it in the view always?
#Html.Partial("~/Views/Home/Search.cshtml")
Button
<a class="btn btn-outline-info mx-2 mx-sm-1" id="nav-btn" data-toggle="modal"
data-target="modal-data" ><i class="bi bi-upc-scan"></i></a>

Related

How to make screenreader read the aria-label of a button while clicking

I'm working on improving the accessibility of an HTML page. I have a "refresh" button. Is it possible that every time I click the button, the screenreader will read out "refreshing".
This is my HTML code:
<button id="refresh_btn" title="refresh the content" aria-label="refresh" class="btn btn-default btn-xs"><i class="fa fa-refresh"></i></button>
You have to investigate the aria-live attribute:
<div aria-live="polite" id="ele"></div>
Each time you press the button you can populate the above tag with the text you want using javascript:
<div aria-live="polite" id="ele">Loading</div>

How to open a bootstrap modal from antoher page html?

I have already finished the code on the page by the way mysite.ru / jqueryform-75cb32 / form.html
How to make it open in the modal window at mysite.ru/report.html on the button
<a class="btn btn-info btn-sm pull-right act_popup_dota" data-toggle="modal" data-target="#modal_dota2">
     Leave a vacancy
</a>
https://pastebin.com/5z0y8yBg
$('#modal_dota2').on('shown.bs.modal',function(){ //correct here use 'shown.bs.modal' event which comes in bootstrap3
$(this).find('iframe').attr('src','http://mysite.ru/jqueryform-75cb32/form.htm');
})

Is it possible to display the description of a button when hovered over?

In my Angular program, I want to display a string of text that says what the button does whenever you hover over the button.
How do I do this?
My mouse is hovering over the google button.
Here's my html code for one of my buttons if it helps:
<button [disabled]="!isDisabled" name="enable" class="btn btn-default btn-margin" (click)="toggleDisabled()"><i class="fa fa-pencil" aria-hidden="true"></i></button>
You can use title
<button [disabled]="!isDisabled" name="enable" class="btn btn-default btn-margin" (click)="toggleDisabled()" title="Something"><i class="fa fa-pencil" aria-hidden="true"></i></button>
did you try the title attribute?
title="hello world"
example here
http://w3schools.com/tags/tryit.asp?filename=tryhtml5_global_title
add
title="my tooltip text"
or
[title]="aPropertyWithTooltipContent"
see also tooltips for Button

Click a link having same class among other classes and same link name among other link name

I want to click on this link automatically. the href and data-id is generated randomly on website. and also have other links on website which have same class and same link name.
I want to click the first link among the other similar link on the webpage.
<a class="btn btn-success btn-mini bid-now ProjectTable-control" href="www.example.com/random" data-id="13033246">Bid Now</a>
Here are some more code for better understanding:
<td class=" ProjectTable-cell ProjectTable-priceColumn price-col"><span class="average-bid">$2400</span><div class="ProjectTable-controls">
<a class="btn btn-success btn-mini bid-now ProjectTable-control" href="/projects/view_new.php?id=13033253#placebid" data-id="13033253">
Bid Now
</a>
<a class="btn btn-primary btn-mini repost ProjectTable-control" data-ttref="PostProject_ProjectListingLoggedIn" data-type="p" data-qts="PostProject" data-id="13033253" href="https://www.example.com/buyers/repost.php?id=13033253">
Post a project like this
</a>
document.getElementsByClassName('bid-now ProjectTable-control')[0].click()

HTML onClick doesn't work with Windows Phone

I have an web app which is working phine on the simulator,android and ios, but on windows phone one onclick event does not work. This is my HTML code:
<ul id ="triggerresolutionbg" class="table-view">
<li class="table-view-cell media">
<element>
<button class="btn btn-link btn-nav pull-left">
<span class="icon icon-left-nav" id ="triggerLeft" onClick = "triggerText(this.id)" ></span>
</button>
</element>
<button class="btn btn-link btn-nav pull-right">
<span class="icon icon-right-nav" id ="triggerRight" onClick = "triggerText(this.id)"></span>
</button>
<element>
<center id ="triggerText">After I...</center>
</element>
</li>
</ul>
I´m using Ratchet,Bootstrap and JQuery.
Why the onclick methods on Windows Phone does not work ?
According to the HTML5 spec for button putting interactive content inside a button element is invalid.
Content model:
Phrasing content, but there must be no interactive content descendant.
So you should not expect event listeners to work on elements inside a button. Some browser violate the spec and permit this, but others do not. Try attaching the onclick handler to the button element itself.
Since you are using this.id, I would recommend restructuring your HTML in the process, but something like this should work.
<button class="btn btn-link btn-nav pull-left" onclick="triggerText(this.firstElementChild.id)">
<span class="icon icon-left-nav" id="triggerLeft"></span>
</button>

Categories

Resources