Adding an input value as a parameter to a hyperlink in HTML

Advertisements How should I structure the following link so that the value of SearchInput is added as a parameter? Thanks <input id="SearchInput" name="SearchInput" type="text" aria-label="Search Input" /> <a href="/search?term="[value from input]>SEARCH</a> I was thinking something like this <a href="#" onclick="this.href = ‘/search?term=’ + document.getElementById(SearchInput).value"> >Solution : Your proposed solution looks almost correct, but you need… Read More Adding an input value as a parameter to a hyperlink in HTML

C# MVC read value inside a div using jquery

Advertisements I am developing an Application in Asp.Net Core MVC6. I have a Razor page that render dynamically object. Assuming I have creating dynamically this two Divs in my page <div id="A1"> <input type="text" id="SearchSSN" /> <input type="text" id="SearchLastName" /> </div> <div id="A2"> <input type="text" id="SearchSSN" /> <input type="text" id="SearchLastName" /> </div> <a href="#" onclick="Search()"… Read More C# MVC read value inside a div using jquery

c# add comma before every numbers in my string except first number

Advertisements I am developing as application in asp.net mvc. I have a string like below string myString = "1A5#3a2@" now I want to add a comma after every occurrence of number in my string except the first occurrence. like string myNewString "1A,5#,3a,2@"; I know I can use loop for this like below myNewString foreach(var ch… Read More c# add comma before every numbers in my string except first number

Using Foreach or another function to reduce the amount of code

Advertisements please help. I have such a code with Checkboxes. I need to shorten it, namely to go through it through Foreach. If you can shorten it in another way, then please write it.. let FormData = { DisplayName: $("#DisplayName").is(":checked"), Department: $("#Department").is(":checked"), Post: $("#Post").is(":checked"), Phone: $("#Phone").is(":checked"), Location: $("#Location").is(":checked"), Dinner: $("#Dinner").is(":checked") } console.log(JSON.stringify(FormData)); I haven’t really… Read More Using Foreach or another function to reduce the amount of code

Calling controller method with a get type not working in ASP.NET MVC

Advertisements I have a java script function that calling a controller method using Ajax, this call should get me the user profile page, I have a controller for this purpose. When I run the program and fire the java script function it’s trigger the controller and every thing is good but when the debugging has… Read More Calling controller method with a get type not working in ASP.NET MVC

ASP.NET MVC validation : string starts with 000 and is followed by another 6 numbers

Advertisements I am validating a string that should be 9 chars long, numbers only and must start with 000. I created the following validation: [RegularExpression("^[0]{3}*", ErrorMessage="{0} must start with 000 and be numeric")] [StringLength(9, MinimumLength=9, ErrorMessage = "{0} must be 9 numb long")] public string Test{get;set;} Is there better way to do it? >Solution :… Read More ASP.NET MVC validation : string starts with 000 and is followed by another 6 numbers