w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
HTML input required attribute or ASP.NET MVC Data Annotations required decorator
Old browsers do not support HTML input require attribute. http://caniuse.com/#search=required http://www.w3schools.com/tags/att_input_required.asp

Categories : HTML

Is it possible to check required input with the HTML required attribute without actually submitting the form?
The OnClick event handler needs to run script code that checks the individual form fields for data, and then returns true only if the data is acceptable, otherwise returns false to abort the submission. Update: rather than using an OnClick event handler on the submit button, you should instead use an OnSubmit event handler on the form itself. That way, having the validation script return true/false has more meaning.

Categories : HTML

MVC data model Drop down list validation says id is required, how do I change to say name is required?
Add: [DisplayName("Name")] to the declaration of TypeID in your view model or change your label to: @Html.LabelFor(model => model.TypeID, "Name")

Categories : Asp Net Mvc

Why class required default constructor but structure dont required?
Because the default constructor of a class (reference type) is only exposed if an explicit one is not implemented (that is, it doesn't exist). A struct (value type) doesn't even need to be new'd, so to speak. You can use a variable that represents a struct without it - i.e. it won't be null, anyway (that is, it needn't exist at all).

Categories : C#

Using functions inside scripts required by NodeJS's required()
If it is not a part of module.exports then you can't. For example: web-notification.js function getURL(host, path) { ... } module.exports = exports = { getURL: getURL }; main-js.js var webnotis = require('./modules/web-notification.js'); webnotis.getURL(...);

Categories : Javascript

Is HTTP status code 426 Upgrade Required only meant signal an upgrade to a secure channel is required?
Quoting one of my previous answers: HTTP Upgrade is used to indicate a preference or requirement to switch to a different version of HTTP or to another protocol, if possible: The Upgrade general-header allows the client to specify what additional communication protocols it supports and would like to use if the server finds it appropriate to switch protocols. The server MUST use the Upgrade header field within a 101 (Switching Protocols) response to indicate which protocol(s) are being switched. Upgrade = "Upgrade" ":" 1#product For example, Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11 The Upgrade header field is intended to provide a simple mechanism for transition from HTTP/1.1 to some other, incompatible protocol. According to the IANA regist

Categories : Http

for loop required and dynamic css required through PHP
You can get rid of the ifs by using an array: $styles = array('12,23' => 'r16', '34,45' => 'r17', ... '1516,1617' => 'r29' ); if (isset($styles["$string,$string1"])) { $style = $styles["$string,$string1"]; } You could also use this array to generate the CSS. Make the values associative arrays containing the class name and CSS, e.g. $styles = array('12,23' => array('class' => 'r16', 'css' => 'text-align: left;padding-left: 100px; border: solid 1px #CCCCCC; margin: 10px 490px 0px 285px;'), ...

Categories : PHP

Static .lib required for compiling library is also required for library users?
Looks like you want partial linking (see --relocatable flag in ld manual page). As I can see from the sources, cabal uses partial linking only libraries, compiled for ghci. From Distribution.Simple.GHC (buildLib function): whenVanillaLib False $ do (arProg, _) <- requireProgram verbosity arProgram (withPrograms lbi) Ar.createArLibArchive verbosity arProg vanillaLibFilePath staticObjectFiles whenProfLib $ do (arProg, _) <- requireProgram verbosity arProgram (withPrograms lbi) Ar.createArLibArchive verbosity arProg profileLibFilePath profObjectFiles whenGHCiLib $ do (ldProg, _) <- requireProgram verbosity ldProgram (withPrograms lbi) Ld.combineObjectFiles verbosity ldProg ghciLibFilePath ghciObjFiles whenSharedLib False $ runGhcProg ghcSharedLinkArgs

Categories : Haskell

Why is YUI.add required when specifying YUI modules and if it is required how can non-YUI modules work?
It's important to distinguish between custom modules that utilize YUI3 features (sandboxed Y.Lang, etc) and completely external code. In the first case, the YUI.add() wrapper is always necessary, because the sandbox Y variable isn't available outside the module callback (the second argument to YUI.add()). The repetition of module configuration is unfortunately necessary in hand-written modules due to constraints within Y.Loader (where the combo-loading magic happens). Modules that employ YUI's build tools have the wrapper and metadata added automagically. With completely external code, you only need to provide the fullpath config property, and YUI will do the right thing. Internally, YUI knows when a given <script> request finishes, and associates that success with the configured m

Categories : Javascript

What's the difference between :focus:required:invalid:focus and :focus:required:invalid?
Here's what the spec says about calculating specificity: A selector's specificity is calculated as follows: count the number of ID selectors in the selector (= a) count the number of class selectors, attributes selectors, and pseudo-classes in the selector (= b) count the number of type selectors and pseudo-elements in the selector (= c) ignore the universal selector Selectors inside the negation pseudo-class are counted like any other, but the negation itself does not count as a pseudo-class. Concatenating the three numbers a-b-c (in a number system with a large base) gives the specificity. Note: Repeated occurrences of the same simple selector are allowed and do increase specificity. There's nothing written about uniqueness, so writing the pseudo

Categories : CSS

"No value given for one or more required parameters."
One or more of the paremeters are null. Check if strPay, strDel or strStatus is null or not. If any of them is null you can send empty string or SqlString.Null. If some parameter value is null that parameter doesn't get added that's why this error. cmd.Parameters.AddWithValue("@Pay", strPay==null?SqlString.Null:strPay);

Categories : C#

p:selectOneMenu value still required
This is because you are using JSTL <c:foreach> with JSF. The life cycle of JSTL vs JSF matters. JSTL is executed when the view is being built, while JSF is executed when the view is being rendered. The two do not work in synch with each other. In your case, you need to use <f:selectItems> instead of <c:foreach> Replace: <c:forEach items="#{datosInstitucion.municipios}" var="municipio"> <f:selectItem itemLabel="#{municipio.nombre}" itemValue="#{municipio.id}"/> </c:forEach> with: <f:selectItems value="#{datosInstitucion.municipios}" var="municipio" itemLabel="#{municipio.nombre}" itemValue="#{municipio.id}"/> For more reading, I suggest you to read the following answer

Categories : JSF

Required help on javascript
The open() method takes a second name parameter which you can use as the target of a post, so you can create a hidden form with a target, open about:blank with a the target name and submit that form. Or you can have a form that submits to the special '_blank' target which also opens a window. Similarly you programmatically fill and submit the form. Edit: I said '_new' which is wrong....

Categories : Javascript

Manifest help required
<action android:name="com.mysmartftp.MainActivity" /> <category android:name="android.intent.category.DEFAULT" /> should be inside an activity tag like this: <activity android:name="com.mysmartftp.MainActivity" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> action specified by you is wrong and category can be Launcher/Default or something else depending on your requiremnet.

Categories : Android

No value given for one of more required parameters
I think you need to add schema.ini file to solve your problems. So, according to this information you need to go as follows: 1.create text file schema.ini and save it in the folder where your tou.txt file is located. 2.your schemat.ini should looks like: [Tou.Txt] ColNameHeader = True CharacterSet = ANSI Format=TabDelimited Now your code should works for Tou.Txt but could not for other files if they are all in the same folder. If so, you need to add to your schema.ini similar sections for all other text files you import.

Categories : Excel

Which PHP modules are required by the SDK
One of the things we're concentrating on over the next few releases is providing dev environment that matches what you have in production. For now, you can get the list of loaded extensions that are available in production from php-minishell.appspot.com, and then use that list to tune your dev setup to match. >>> print implode(", ", get_loaded_extensions()); Core, date, ereg, libxml, openssl, pcre, zlib, apc, bcmath, calendar, ctype, dom, filter, gd, hash, iconv, json, mbstring, mcrypt, SPL, session, standard, OAuth, mysqlnd, PDO, pdo_mysql, Reflection, mysqli, shmop, SimpleXML, soap, mysql, tokenizer, xml, xmlreader, xmlwriter, GAE Runtime Module, urlfetch_stream_wrapper_plugin, memcache, memcached, google_cloud_sql_mysqlnd_plugin

Categories : PHP

Url Rewrite Help required
RewriteCond %{HTTP_HOST} ^(.+).o9village.com$ RewriteRule (.*) o9_advertiser/ad_list/ad_list.php?country=%1 [L] In first line, it checks whether it's something like iran.mydomain.com or not? if yes, it goes to rewrite rule which redirect user to http://mydomain.com/o9_advertiser/ad_list/ad_list.php internally (User can not see the redirection in his/her browser). if you use var_dump function in ad_list.php to see $_GET array, you will see something like: array(2) { ["country"]=> string(4) "iran" ["path"]=> string(9) "index.php" } Edit: OK, Log into your CPanel account, create a sub-domain *.o9village.com. set Document Root to point at Document Root of your main domain o9village.com. Now, if you browse iran.o9village.com, you will see same page as http://o9villa

Categories : PHP

moving a div when required
Im not the best with math, but basically you need to find out how much your scrolling content has moved, and stop it from moving when it has moved too far up or down. I have created a similar thing to what yo umay be trying to achieve, here http://codepen.io/lukeocom/pen/nHuri I get the height of the container and the height of the content, and then check that the amount the content has scrolled minus the height of the container, is less than the height of the content. It's all very confusing to my math weak brain, but perhaps you can figure out an easier method. At any rate, my example works. You need to be careful with how much you scroll the content by, as well as how quick the animation is completed, and how often the interval is fired. I'll attempt to clean up the working code ex

Categories : Javascript

US Map Plugin Help Required
Use a vector Drawing tool (like Inkscape) to add the Territory names to SVG file then replace the existing Blank_US_Map.svg To implement the link behavior you want change $('#map').usmap({ // The click action click: function(event, data) { window.location.href = date.name+".html"; } });

Categories : Javascript

Cad/Cam maths required
Linear algebra is definitely a good start. Also, you are probably familiar with polygon meshes, that's good too. If I would interview for a CAD job I would read up on other geometry representations. In particular NURBS and Constructive Solid Geometry (CSG). I don't think rendering APIs are too important here, but you should have a solid understanding of how ray tracing works and how to use the just mentioned surface types in both a ray tracer and in a rasterization-based pipeline.

Categories : Misc

Is htmlspecialchars() required on ALL output?
Well, if you don't want XSS problems, then using htmlspecialchars() is a good idea. If you didn't, someone could store a malicious <iframe>, or <script> in your code. Now, you don't necessarily need to protect the output. If you sanitize the data coming in, you can store the sanitized data instead. Doing it this way allows you to purposefully store non-sanitized data for maybe styling purposes which would be ready for output. As far as your example is concerned, it is correct. That is one way you can do it. EDIT: You only need to apply htmlspecialchars() to strings.

Categories : PHP

How to see .p files' required input?
You cannot see the code of a Matlab p-code file. p-code files exists so that one can share code in order that others can't look at it. type on matlab command window; help <p-code file name> (if the corresponding .m has comments sections for its inputs and return values, or other documentations, you can probably see them) You could probably get some idea for its inputs, from the error thrown just by typing the p-code file name.

Categories : Matlab

Required field in model
It seems that objectify has no such functionality, where you would require user to set a value of field. You can however prevent saving of fields with null value: @IgnoreSave(IfNull.class). (you can use any of the [If][2] subclasses: IfDefault, IfEmpty, IfEmptyString, IfFalse, etc..)

Categories : Java

Prefix for CSS3 isn't required?
According to caniuse.com (first google result) the vendor prefix will support a few outdated versions of Mozilla and Webkit-based browsers. Link: http://caniuse.com/css-boxshadow

Categories : CSS

Optional VB Parameters are required in C#
C# doesn't support optional ref parameters. If you change obj to be a ByValue parameter, it should be fine. If you try to declare an optional ref parameter in C#, you'll violate section 10.6.1 of the C# 4 spec: A fixed-parameter with a default-argument is known as an optional parameter. ... A ref or out parameter cannot have a default-argument. The exception to this is for COM, where ref parameters are extremely common. When the C# compiler knows it's dealing with a COM component, it will allow you to omit optional ref parameters.

Categories : C#

The cipher 'aes256-cbc' is required, but it is not available
You need to add to Your JRE - java unlimited strength policy, eg.: http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html Please replace local_policy and us_export_policy on the server's JRE path (libsecurity) Other version of JCE policies can be found on oracle web pages.

Categories : Misc

Rails 3.2: rake 10.0.3 required
You either need to run the command in the context of the bundle (recommended): > bundle exec rake db:version Or you need to uninstall the offending rake gem version. > gem uninstall rake > # pick version 10.1.0 from the offered choices.

Categories : Ruby On Rails

PHP array manipulation help required
Assuming the array you posted is $data, this will give you an associative array with the key being the retailer id. As the retailer is non unique, it will be an array of one or more "products". $result = array(); foreach ($data as $row) { $id = $row['retailer']; if (! isset($result[$id])) $result[$id] = array(); $result[$id][] = array( 'productid' => $row['productid'], 'quantity' => $row['quantity'], 'discount' => $row['discount'], ); }

Categories : PHP

Column wise sum required
Suppose oops == {1, 2, 3, 4, 5, 6}, and vector is v == {1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6} // 3 ROWS (Did I get you correctly?), and ROWS == 3, and columns == 6. Then accumulator = oops[position], i.e. we init it to the corresponding oops entry and you can do for (int i = 0; i < ROWS; i++) { accumulator += v[position + i * COLUMNS] } So, if you need sum in third column: accumulator == oops[2] == 3 on the initial phase and then you do accumulator += v[2] // == 3 and so on. Just change the code to fit your values and go.

Categories : Java

CSS styling issue help required
I have took a look at your fiddle and when applying the 25% to the width CSS on the .equal and making the width of the .effect 100% nothing seems to have changed. It all seems to work fine and not stick together like you stated. I'm unsure as to what problems you are facing as the fiddle seems to be running fine with the desired percentages.

Categories : HTML

CodeContracts "Required" understanding
It seems that you are trying to do a couple of things at once here: Contract.Requires should be used on the input parameter directly, e.g. if id should never be null, then do like so: Contract.Requires<ArgumentNullException>(id != null); In addition, it seems that you want to guarantee that the result isn't null. Do this like so: Contract.Ensures(obj != null); Similarly, additional contracts can be checked by your helper method (Get).

Categories : C#

What is required for a successful php session?
Default practice in PHP these days** when dealing for sessions if for PHP to generate a cookie for the client to store. Your java client must store this cookie (called phpsessid by default, but any PHP programmer worth their salt will change the cookie name), and present it in the HTTP headers on subsequent requests. I'm not very familiar with the HTTP support in Java, but if it's anything like curl it will include options for setting and retrieving cookies. ** It used to be possible to pass session tokens by a query string (a GET parameter) when making the request, but as this was horribly insecure and leaked potentially sensitive information, it's never used any more and may even no longer be available as an option.

Categories : Java

What is AABB? Explanation required
Well, axis-aligned bounding box is a... simple box :) You didn't give me any fundamentals regarding your project though. Anyway, the bounding box is just a math box, that is able to describe any physical body in three dimensions. Just try to wrap your body with many boxes and you'll find out that it's sufficient to cover all the physics. It is used in games heavily because of its simplicity. You may do the same things on sphere-models, but with more complicated shapes you get more complicated math, then you get more overload which is too much for current CPU (including gpu). But totally, there is nothing to explaing, concerning you won't need some maths. It's a simple box that is used to compare collision with another AABB, including help of triangle "normals" and "matrix" transformation

Categories : Actionscript

How there is Lvalue required error
max is a literal so max++ will fail. (Just as 10++ will fail). However, max + 1 is valid (just as 10 + 1 is). Remember that #defines are resolved by the preprocessor which happens before compilation takes place. To explain your compiler's return error: Loosely speaking, an lValue is the thing on the left hand side of an assignment; i.e. in a = b; a is the lValue. The statement 10 = b; is clearly meaningless (you can't assign a value to 10): more formally it is invalid since 10 is not an lValue.

Categories : C

C# class with required fields
Passing fields that are required to constructors should be fine. Your code doesn't look dirty yet, but if it started to grow say 10 required fields, then it is better to create an object that contains all the required fields and then use that object when creating the object (Constructor). Right now this is not dirty class MyClass { private string Field1; private int Field2; public MyClass(string Field1, int Field2) { this.Field1 = Field1; this.Field2 = Field2; } } If it became like this class MyClass { private string Field1; private int Field2; public MyClass(string Field1, int Field2, int Field3, int Field4, int Field5, int Field6, int Field7, int Field8, int Field9, int Field10) { this.Field1 = Field1; this.Field2

Categories : C#

MVC Required Field not Working
You have to take the Model as the parameter to your Login action public ActionResult Login() { // This will return the view with the form that you have above return View(); } [HttpPost] public ActionResult Login(Login login) { // this is what your form will post too if (ModelState.IsValid) { bool validLogin = new UserBAL().ValidateUser(login.FirstName, login.Password); { if (validLogin == true) { return RedirectToAction("Index", "Invoice"); } else { return RedirectToAction("Index"); // ModelState.AddModelError("", "The user name or password provided is incorrect."); } } } return View(); } In the View just have @using (

Categories : Asp Net Mvc

htaccess not working as required
Firstly, you have some stray spaces in your mod_alias Redirect directives: Redirect bootstrap/engagement-ring.php http://www.mydomain.co.uk/bootstrap/engagement- ring Redirect bootstrap/inferno-diamonds.php http://www.mydomain.co.uk/bootstrap/inferno- diamonds These will cause a 500 server error, because it has the incorrect 3 parameters. Secondly, your Redirect directives need to match against a leading /, so they all need to look like: Redirect /bootstrap/rolex-watch.php http://www.mydomain.co.uk/bootstrap/rolex-watch But those 2 issues are really just moot because you've created a redirect loop by rewriting the URI with your last rule, and redirecting again via the Redirect statements. The two different modules that you are using, mod_alias (Redirect) and mod_rewrite (Rew

Categories : Htaccess

Error 424 Object required on End Sub
I tried something simple and it didn't compile (a variable name same as the Sub name). May be you should define and use a Long type variable lngDeleteRow: Sub DeleteRow() Dim lngDeleteRow as Long Debug.Print "ActiveWorkbook: " & ActiveCell.Worksheet.Parent.Name Debug.Print "ActiveSheet: " & ActiveCell.Worksheet.Name Debug.Print "ActiveCell: " & ActiveCell.Address If Err.Number <> 0 Then Debug.Print "DeleteRow() : ERR " & Err.Number & " " & Err.Description Err.Clear End If lngDeleteRow = ActiveCell.Row If ActiveWorkbook.Worksheets("Major Projects").Range("A" & lngDeleteRow) = "x" Then ActiveWorkbook.Worksheets("Major Projects").Rows(lngDeleteRow).EntireRow.Delete Else MsgBox "You haven'

Categories : Excel

How to know the Number of Core and RAM Required?
I'll try and list a few constraints that I can think of, but there might be more: webserver with apache running Take a look at the number of file handles that are used (in case apache serves static content like css, javascript or images). Additionally, the number of http connections might be a constraint (normally one per concurrent user). Another constraint might be the number ajp worker threads that pass requests to tomcat. Memory constraints requirements might not be that huge but that depends on what your apache does. app server with Tomcat running Here the size of the sessions would be a constraint. Note that depending on the session timeout, the number of concurrent sessions might be much higher that the number of concurrent users (not all need to do concurrent requests, but

Categories : Java

Local files required for git?
All of your code should be version controlled, with pretty much no exception besides generated content. Not doing so seems rather counterproductive. If you do want to track just a single directory, make it into its own repository. If you're talking about static assets, you can consider adding your asset directories to .gitignore and distributing them via another channel. To address your added question: your repository should maintain a single state across your machines, i.e. every machine that accesses the code should have a copy of the entire history of the project and its constituent files. That's pretty much the essence of DVCS. When you want to deploy, you pull in the delta from your local copy to the production server.

Categories : GIT



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.