Posts by Marcos Brinner • 1,282 points
97 posts
-
-3
votes1
answer30
viewsA: Selection of two files with Input type file
Well, javascript has its limitations so you don’t have access to the file path because it generates a fake path but vc can do a workaround by letting the user select the folder, ai vc makes an…
-
-3
votes3
answers54
viewsA: I wonder if I can modify a string inside an array without knowing its position
The most coherent way would be to create a prototype, so you can use the function in local verios in a simple way. Array.prototype.replaceAll = function (oldValue, newValue){ for(var i = 0; i <=…
-
1
votes1
answer1534
viewsA: Error opening C#project files
This error occurs by some corrupted proj file. Visual Studio always saves a backup of these files in a folder. Sail to: C:\Users\<Seu Usuário>\Documents\Visual Studio <Vs versão>\Backup…
visual-studioanswered Marcos Brinner 1,282 -
0
votes1
answer43
viewsA: Session in php giving error
First you need to reference who registered the pet, for this you need to add a Foreign key in your pets table ALTER TABLE novo_pet ADD id_usuario_cod_fk int not null ALTER TABLE novo_pet ADD FOREIGN…
-
1
votes1
answer32
viewsA: Array inside the foreach returns last column of the database
You are declaring a new array every time you pass the foreach, try using an example push array public function Acentos ( $string ) { $table = array(); $Acentos = $this->SelectDados( "*", "table",…
phpanswered Marcos Brinner 1,282 -
2
votes1
answer2188
viewsA: Nullable Object must have a value
Set a default value for your EmpresaID Example: int EmpresaID ?? 0 Guid EmpresaID ?? Guid.Empty var pesquisa = from pro in db.Produtos join prodempresa in db.ProdutosEmpresas on pro.Id equals…
-
3
votes1
answer269
viewsQ: What kind of . NET library should I choose in C#project?
I’m thinking of creating a new project in c# I saw three types of libraries that caught my attention and I couldn’t distinguish exactly what would be the best applicability in each project. .NET…
-
1
votes1
answer95
viewsA: How to pass a default parameter value within a foreach in C#?
Well, you could use Linq to do this operation, plus lighter and cleaner code try var items = ListaEmpregados.Where(x => x.Any(z => z.getCodigo() == x.getCodigo()) );…
-
0
votes2
answers81
viewsA: How to use WHERE function in column created from a query?
Try the following select a.campo1, b.campo1,replace(replace(b.campo1,'-',''),'.','') as resultado from dbo.tabela1 a, dbo.tabela2 b where a.campo1 = replace(replace(b.campo1,'-',''),'.','') Cannot…
-
0
votes1
answer34
viewsA: How do you get the last div of the same class glued to the margin?
You can use .class:last-child { margin-bottom:0px } However in this case any last elmento will apply the style To ensure that the element is only the div use the following code .class…
cssanswered Marcos Brinner 1,282 -
4
votes3
answers104
viewsA: Change project c# . Net 4.6 to . Net4.5
1 - Go to Solution Manager 2 - Right click on the project you want 3 - Go on properties 4 - Click on App 5 - Change the Destination Structure and ready Remembering that all projects within the…
-
0
votes1
answer20
viewsA: How to avoid automatic datetime field formation in Mysql with Asp Net?
Well you can set Culture info en-US in your application but this can lead to many changes like currency formatting etc, so I think the best way would be to convert the date even if you don’t want to…
-
2
votes1
answer32
viewsA: Join in four tables using LAMBDA
try to make this froma, I do not know how is the name of the tables in your context so you will need to change, but basically this is it var query = from o in db.office join e db.employee on…
-
0
votes2
answers1958
viewsA: How to automatically set the autofocus attribute to HTML input by Javascript?
You can do this by adding to the event that opens the modal function abrirModal(){ var element = document.getElementsByName("email")[0]; element.focus(); } I made some corrections to the code and…
-
4
votes2
answers124
viewsA: How to verify that the email is already registered in the database?
You’re comparing whether the email matches the string "Email" while actually seeing if it’s what it contains in the person model in this way pessoas.Email public ActionResult Create([Bind(Include =…
-
1
votes1
answer60
viewsA: Run Event Textbox c# WPF
Try something like this. public Window1() { InitializeComponent(); // "tb" é o seu TextBox DataObject.AddPastingHandler(tb, OnPaste); } private void OnPaste(object sender, DataObjectPastingEventArgs…
-
1
votes1
answer181
viewsA: Remove all HTML attributes
Use that regular expression <.*?>|</.*?> And replace it with "nothing" Same in the image below Squeeze Ctrl + f to open the dialog Note: Remember to mark down the field "regular…
-
0
votes2
answers45
viewsA: Add Mil separator to a number animated by jquery
Change your function numberToReal this way below. See working here insert link description here function addDots(nStr) { nStr += ''; var x = nStr.split('.'); var x1 = x[0]; var x2 = x.length > 1…
jqueryanswered Marcos Brinner 1,282 -
0
votes1
answer206
viewsA: Using Identity with Entity Framework to relate one-to-Many methods to other tables
Look for your Identitymodel.Cs is usually within Models/IdentityMode.cs Within your class public class ApplicationUser : IdentityUser Create a new property of type public virtual Barco Barco {get;…
-
0
votes2
answers51
viewsA: Save data from a Row to an array
Just create a lits<t> where T is the class or type you want to store Suppose it’s an int Lits<int> meusDados = new List<int>(); foreach (int i in gvDados.GetSelectedRows()) {…
-
0
votes1
answer41
viewsA: WPF - Trigger elements within a wrap panel
I think the most coherent way to do what you want is to create a Rigger create a Resource style <Style x:Key="MeuMauseOver" TargetType="DockPanel"> <Style.Triggers> <Trigger…
-
0
votes1
answer52
viewsA: Filling select with latitude, longitude and city according to Json
Remove the other loops and leave only this, the way you created each loop runs at a time or so is getting only the last values. $.each(val.cidades, function (key, value) { var val_city =…
-
0
votes2
answers289
viewsA: How to join different foreach results in an array?
<?php $titulo = $html->find('.Cartaz .filme-single-name text'); $capa = $html->find('.Cartaz .filme-img'); $link = $html->find('.Cartaz .mais_info a'); $novaArray =…
-
1
votes3
answers3047
viewsA: Accessing variable in another class comes null - C# Visual Studio 2015
Well try to operate an instance controller class, you are probably calling the click at a different instance than the click location public static class ControleInstancia { public static Form2…
-
1
votes1
answer46
viewsA: C# WPF Binding a 2 Radiobuttons as per a Boolean
use the datatrigger to where PropriedadeBool is the property Boolean that you are checking <RadioButton x:Name="radioButtonPlus" Content="Acumulação" HorizontalAlignment="Left" Margin="0,10,0,0"…
-
1
votes1
answer482
viewsA: Open div by hovering over input text
Stick your css to #mostrar { display: none; } #passarmouse:hover + #mostrar { display: block; } <div class="col-md-4" id="passarmouse"> <input type="text" asp-for="FornecedorID"…
cssanswered Marcos Brinner 1,282 -
-1
votes3
answers1130
viewsA: How to format a php array
Let’s see you are printing a subarray that is found by for each if you want to print this way you will be no longer having an array and will have a string can do this by implode function foreach…
-
0
votes2
answers165
viewsA: Prevent multiple uploads with jquery
Your code is badly stamped You are setting every time your "body"" hears a click it will add an Eventlistener to your $("#btn-true") button ie if you excutate action 3 times it will add 3 events on…
-
0
votes2
answers147
viewsA: Access control Access-Control-Allow-Origin on the Apache PHP server side
This is a type of lock that occurs on the application server you can bypass by sending an inherited that accepts all sources header('Access-Control-Allow-Origin: *'); Very important that this be…
-
0
votes2
answers77
viewsA: How to call class by class, just picking the one the mouse is on top of, without picking up the others simultaneously?
You will need to use jquery or pure javascript here follows an example <script> $(".lis-fil").mouseover(function(){ var divAutal = $(this); var formAtual = divAtual.find("form");…
-
1
votes2
answers48
viewsA: Javascript + CSS : Doubt about Value or textContent
In your script there is an error you’re using =! instead of != and you’re making a redundant comparison function teste() { var elements = document.getElementsByClassName("testetxt"); if…
-
1
votes1
answer147
viewsA: Problem with a javascript function
Change that line var pesoDoPrimo = 70; var AlturaDoPrimo = 1.75; calcularIMC(AlturaDoPrimo, pesoDoPrimo); for var pesoDoPrimo = 70; var AlturaDoPrimo = 1.75; var imcDoPrimo =…
-
0
votes1
answer94
viewsA: Visible password
Try putting in the checkbox onchange event <asp:CheckBox ID="chbox_mostrarpassword" runat="server" Text="Mostrar Palavra-Passe" onchange="document.getElementById('lbl_password').type =…
-
1
votes2
answers1715
viewsA: Return entire part in Javascript
The parseint(); will transform a string (string sequence) into an integer that is if you have an "as1" string it converges to 1 or if there is a conversion error it will return an Nan The…
-
1
votes2
answers1372
viewsA: How to put a timeout or disable a set time button in PHP or Javascript?
Filing cabinet clickado.php <?php $time = time(); $usuario = $_POST['usuario']; $fp = fopen("timerdobotao.txt", "w+"); $escreve = fwrite($fp, $time); fclose($fp); ?> Filing cabinet php check.…
-
2
votes2
answers766
viewsA: Compare php texts
What you’re looking for is called text diff Has some opiations: PHP Inline Diff (uses PEAR text-diff) PEAR Text_diff Diff in Pure PHP xdiff_string_diff() Relacionados no Stackoverflow em ingles:…
-
1
votes2
answers102
viewsA: Register a separate array in the database
I think you can blow up the comma and turn it into an array, then you put it in a loop and take the values by the index <?php $nome = $stringNome.explode(","); $code = $stringCodigo.explode(",");…
-
1
votes1
answer155
viewsA: jquery how to receive data line by line in a loop
Good you can split the same Breakline in the code below $(Document). ready(Function(){ $(".btenvia").click(function(){ $.post("dados.php", {opcao: 1 }, function(info){ var rt = info.split("\n"); var…
-
0
votes1
answer359
viewsA: Image gallery with scrolling
Well you can do it using javascript and jquery created a very simple script here ( see working here ) add to your code <script…
-
0
votes3
answers87
viewsA: ASP.net MVC error
To see errors use the following code in your savaChange try { ... o restante do codigo db.SaveChanges(); } catch (DbEntityValidationException e) { foreach (var eve in e.EntityValidationErrors) {…
-
1
votes1
answer69
viewsA: Prohibit other sites from using my content
Good What you are looking for calls Hotlink which is a way to prohibit people from doing Usu of your files thus generating use of Bandwidth you can use a code similar to this RewriteEngine on…
-
4
votes2
answers100
viewsA: Scrolltop does not work after certain scrolling
Your code has some errors first your search selector must be an ID or Class then it must be "#search" or ". search" second variable javascript does not have $ so the code should look like this var w…
-
0
votes3
answers657
viewsA: Click and dblclick in javascript
Well I guess what you need to do is a little more complex than that, so I used the jquery library that can be downloaded here What happens you will not be able to put a dbclick and an onclick in the…
-
1
votes2
answers174
viewsA: Get type of user connection in javascript
navegator.connection() Here is a brief summary of use if(navigator.connection) { if((navigator.connection.downlinkMax && navigator.connection.downlinkMax>1) ||…
-
0
votes1
answer159
viewsA: Show all Game cards in Javascript
function loadContent() { $(".progressbar").css("display", "none"), cards = shuffle(cards); } setTimeout(function(){ for (var n = "", e = 0; e < cards.length; e++){ n += '<div…
javascriptanswered Marcos Brinner 1,282 -
1
votes1
answer26
viewsA: start with 9 in front with jquery
You can do something like this $("input").keydown(function(e) { var oldvalue=$(this).val(); var field=this; setTimeout(function () { if(field.value.indexOf('9') !== 0) { $(field).val(oldvalue); } },…
-
1
votes3
answers838
viewsA: Check Whether Datagridview field of type Datagridviewcheckboxcolumn is marked
If you have used an itemSoucer(model) to fill your Datagridview you can put a Biding for a certain field that in case would be your Checkbox within your model create a new element called MARKED and…
-
4
votes2
answers1194
viewsA: What is an Engine?
Engine is like an engine with support for various specific functions for each type of use in the case of Razor as cited is a View engine that works with HTML and CSS graphical mode, the Engines are…
-
0
votes1
answer106
viewsA: Doubt about the function Explode -PHP
There are two types in php explode() and the preg_split() Below you can see the difference between the two In a simple use explodes() is much faster, But preg_split has the advantages of using the…
phpanswered Marcos Brinner 1,282 -
1
votes1
answer32
viewsA: Sending email with dynamic inputs
From a foreach in your example fields foreach($_POST['nome-amigo'] as $key => $val){ $nome_amigo = $_POST['nome-amigo'][$key]; $telefone_amigo = $_POST['telefone-amigo'][$key]; $data =…