Search Results

Search found 21097 results on 844 pages for 'check snmp'.

Page 58/844 | < Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >

  • javascript check function for a html form

    - by Reteras Remus
    I'm having a problem with a HTML form (name, e-mail, subject, message), I can't validate the form if it was completed correct or not. I want to call a javascript function when the form is submitted and alert if a field wasn't completed correct. My problem is with the submit button, because my boss said that I must use he's own php function to insert a submit button. The php function looke like: function normal_button($text, $width, $param = '', $class = 'button-blue') { $content = '<div class="'.$class.'" style="width:'.$width.'px;" '.$param.'>'.$text.'</div>'; return $content; } and how I call the function: echo normal_button('Send it', '100', 'onclick="document.getElementById(\'emailForm\').submit();" '); I tried to call the js function declaring the onSubmit="return checkForm(this)" in the <form action='email.php' method='post'> HTML form, but I can't "catch" the submit. Also I tried to catch it with jquery, $(document).ready(function() { $('.normal_button').click(function() { }); ); but I can't return false if a field wasn't completed correct. I must use he's PHP function to insert the submit button, but how can I "catch" the fields, how can I validate them? Any suggestions? Thank you !

    Read the article

  • PHP: Check if URL redirects?

    - by Industrial
    Hi everybody, I have built a secured login backend that controls if a user is logged in or not. If not, the user is redirected to a login page. I would like to make a PHP function that iterates through a number of set url:s (array with url:s) to see if they are redirected or not. How could this be done? Thanks

    Read the article

  • Apple Push Notification Feedback Service - how frequently does it check

    - by gem
    I have been able to successfully create push notifications and I have also received responses from the feedback service, so I am confident that my configuration is correct, but I was wondering, how long after a device has been made inactive, will it be picked up by the Apple Push Notification Service. When I first polled the feedback service, I received details on devices which were inactive several days ago. Now, while testing, when I uninstall the application and occasionally poll the feedback service, I'm not receiving any results. Any idea on how long it takes to update would be useful, as I'm no longer sure if the issue is else where in my code or if I'm just testing too soon. Thanks in advance

    Read the article

  • Check to see if CallResponder is processing

    - by Travesty3
    I'm using Flash Builder 4.6. As a simple example, say I have the following application: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:sdk="services.sdk.*"> <fx:Script> <![CDATA[ private function btnGetValue_clickHandler():void { getValueResult.token = sdk.getValue(); } private function getValueResultHandler():void { // ... } ]]> </fx:Script> <fx:Declarations> <sdk:SDK id="sdk" fault="{Alert.show(event.fault.faultString +'\n\n'+ event.fault.faultDetail, 'SDK ERROR');}" showBusyCursor="false"/> <s:CallResponder id="getValueResult" result="getValueResultHandler()"/> </fx:Declarations> <s:Button id="btnGetValue" click="btnGetValue_clickHandler()" label="Get Value" /> </s:Application> So when you click on the button, it calls a PHP file and when it gets a result, it calls getValueResultHandler(). Easy enough. But what if the response from the PHP file takes a second or two and the user clicks the button rapidly? Then the result handler function may not get called every time, since the call responder gets a new token before it received the last response. Is there a standard way of resolving this issue? I came up with the following workaround, and it works fine, but it seems like this issue would be common enough to have a more built-in solution. My workaround is: var getValueResultProcessing:Boolean = false; private function btnGetValue_clickHandler():void { var interval:uint = setInterval(function():void { if (!getValueResultProcessing) { getValueResultProcessing = true; getValueResult.token = sdk.getValue(); clearInterval(interval); } }, 100); getValueResult.token = sdk.getValue(); } private function getValueResultHandler():void { getValueResultProcessing = false; // ... } Any better way of resolving this issue?

    Read the article

  • jQuery check if element have css attribute

    - by Mircea
    I need to know when I click on an element if this element have a css option. I am thinking at something like this but it does not work: if ($('#element').attr("text-shadow")) { alert ('i Have') } else { alert ('i dont') } Any tips on this one? Thanx

    Read the article

  • How to check if a number is a power of 2

    - by configurator
    Today I needed a simple algorithm for checking if a number is a power of 2. The algorithm needs to be: Simple Correct for any ulong value. I came up with this simple algorithm: private bool IsPowerOfTwo(ulong number) { if (number == 0) return false; for (ulong power = 1; power > 0; power = power << 1) { // this for loop used shifting for powers of 2, meaning // that the value will become 0 after the last shift // (from binary 1000...0000 to 0000...0000) then, the for // loop will break out if (power == number) return true; if (power > number) return false; } return false; } But then I thought, how about checking if log2x is an exactly round number? But when I checked for 2^63+1, Math.Log returned exactly 63 because of rounding. So I checked if 2 to the power 63 is equal to the original number - and it is, because the calculation is done in doubles and not in exact numbers: private bool IsPowerOfTwo_2(ulong number) { double log = Math.Log(number, 2); double pow = Math.Pow(2, Math.Round(log)); return pow == number; } This returned true for the given wrong value: 9223372036854775809. Does anyone have any suggestion for a better algorithm?

    Read the article

  • Android internet connectivity check problem

    - by Chaoz
    Hello, I'm new to Android development and working on an Android application that requires the phone to be connected to the internet, through either Wifi, EDGE or 3G. This is the code that I'm using: public static boolean isConnected() { ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); return cm.getActiveNetworkInfo().isConnectedOrConnecting(); } I've also set these permissions in the manifest file: <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> This works fine in the emulator running version 1.5 of Android when 3G is enabled, but it crashes when I disable the 3G connection. My application throws a null pointer exception when I call isConnectedOrConnecting(). Hope that anyone knows the solution to this. Thanks in advance!

    Read the article

  • jsp error plz check this code why are not insert my data into database

    - by lekhni
    <%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> <%@ page import="java.sql.*" %> <%@ page import="java.io.*"%> <%@ page import="java.io.File"%> <%@ page import="java.util.*"%> <%@ page import="java.sql.*"%> <%@ page import="java.sql.Blob"%> <%@ page import="java.sql.PreparedStatement"%> <%@ page import="java.sql.BatchUpdateException"%> <%@ page import="javax.servlet.*"%> <%@ page import="javax.servlet.http.*"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>My JSP 'p.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> </head> <body> <% int activityId = Integer.parseInt(request.getParameter("activityId")); String name = request.getParameter("name"); String activityType = request.getParameter("activityType"); int parentId = Integer.parseInt(request.getParameter("parentId")); String description = request.getParameter("description"); %> <% Connection conn=null; PreparedStatement pstatement = null; try{ Class.forName("com.mysql.jdbc.Driver"); conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/pol","root","1234"); Statement st=conn.createStatement(); String queryString = "INSERT INTO activity(activityId,name,activityType,parentId,description)" + " VALUES (?, ?, ?, ?, ?)"; pstatement = conn.prepareStatement(queryString); pstatement.setInt(1, activityId); pstatement.setString(2, name); pstatement.setString(3, activityType); pstatement.setInt(4, parentId); pstatement.setString(5, description); } catch (Exception ex) { out.println("Unable to connect to batabase."); } finally { pstatement.close(); conn.close(); } %> </body> </html>

    Read the article

  • Rewrite URL based on file existence check

    - by Anthony Faull
    I need to redirect web requests of the form /{language}-{country}/{file} to: /{language}-{country}/{file} if it exists, otherwise /{language}/{file} if it exists, otherwise /en-US/{file} The existing .htaccess fulfils requirements 1 and 3. What changes do I need to fulfil requirement 2? .htaccess: Options +FollowSymLinks RewriteEngine On RewriteCond $0 !i18n/en-US [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(i18n)/([^/]+)/(.*)$ $1/en-US/$3 [NC,L]

    Read the article

  • Check the code n point the mistake

    - by Vibha
    here is the code: Ext.onReady(function(){ alert("inside onReady"); Ext.QuickTips.init(); var employee = Ext.data.Record.create([ {name:'firstname'}, {name:'lastname'}]); var myReader = new Ext.data.JsonReader({ root:"EmpInfo", },employee); var store = new Ext.data.JsonStore({ id:'ID' ,root:'EmpInfo' ,totalProperty:'totalCount' ,url:'test.php' ,autoLoad:true ,fields:[ {name:'firstname', type:'string'} ,{name:'lastname', type:'string'} ] }); var myPanel = new Ext.grid.GridPanel({ store: store ,columns:[{ dataIndex:'firstname' ,header:'First Name' ,width:139 },{ dataIndex:'lastname' ,header:'Middle Name' ,width:139 } ] }); var myWindow = new Ext.Window({ width:300, height:300, layout:'fit', closable:false, resizable:false, items:[myPanel] }); myWindow.show(); }); And php code is: true, "data" = array( "firstname" = "ABC" , "lastname" = "MNO") ); $_SESSION["err"] = isset($_SESSION["err"]) ? !$_SESSION["err"] : true; header("Content-Type: application/json"); echo json_encode($o); ? I want to print the values ABC and MNO in the grid panel. i'm using extjs 2.3. please help me out. Thanks

    Read the article

  • Foolproof way to check for nonzero (error) return code in windows batch file

    - by Pat
    Intro There's a lot of advice out there for dealing with return codes in batch files (using the ERROLEVEL mechanism), e.g. Get error code from within a batch file ERRORLEVEL inside IF Some of the advice is to do if errorlevel 1 goto somethingbad, while others recommend using the %ERRORLEVEL% variable and using ==, EQU, LSS, etc. There seem to be issues within IF statements and such, so then delayedexpansion is encouraged, but it seems to come with quirks of its own. Question What is a foolproof (i.e. robust, so it will work on nearly any system with nearly any return code) way to know if a bad (nonzero) code has been returned? My attempt For basic usage, the following seems to work ok to catch any nonzero return code: if not errorlevel 0 ( echo error level was nonzero )

    Read the article

  • How to check for undefined or null variable in javascript

    - by Thomas Wanner
    We are frequently using the following code pattern in our javascript code if(typeof(some_variable) != 'undefined' && some_variable != null) { // do something with some_variable } and I'm wondering whether there is a less verbose way of checking that has the same effect. According to some forums and literature saying simply if(some_variable) { // do something with some_variable } should have the same effect. Unfortunately, Firebug evaluates such a statement as error on runtime when some_variable is undefined, whereas the first one is just fine for him. Is this only an (unwanted) behavior of Firebug or is there really some difference between those two ways ?

    Read the article

  • How to check a complex condition in Smarty(PHP)

    - by php html
    I need to display a section or another in a smarty template. My condition is simple: if a smarty value starts with a string I should display one section, otherwise the other smarty section should be displayed. I can change only the tpl files. {php} if (substr($url,0,4) != 'http') { {/php} section 1 {php} } else { {/php} section 2 {php} } {/php} The problem is that I can not read the url varible which was previously assigned using $smarty-assign. Basically, I'm looking for the smarty function that can be used to retrieve a value, or if there is a better solution.

    Read the article

  • MySQL: Check if first character is _not_ A-Z

    - by dbemerlin
    I have to create an SQL Query to get all rows starting with a specific character, except if the parameter passed to the (PHP) function is 0, in that case it should get every row that does not start with A - Z (like #0-9.,$ etc). What is the easiest and fastest way to get those rows? DB: MySQL 5.1 Column: title

    Read the article

  • How to check for exception further down a pipeline

    - by laertejuniordba
    Hi all I am using New-Object System.Management.Automation.PipelineStoppedException To stop the pipeline OK..works.. But how Can I test in the next cmdlet if was stopped ? Foo1 | foo2 | foo3 Stop in foo1, but goes to foo2. I want to test if was stopped in foo1 to stop too in each function function foo1 { process { try { #do } catch { New-Object System.Management.Automation.PipelineStoppedException } } } and still going to the next cmdlet, as stopped by error I want to stop in each next cmdlets..:) Thanks !!!

    Read the article

  • Check for state change in objects using serialization?

    - by sev7n
    I have a form that is bind to an object, and when the user trying to leave the form, I want to warn them if anything on the form has been changed, and prompt them to save. My question is, is there any way to achieve this without implementing IComparar for all my classes in the binded object? I was thinking if there is a way I can serialize my object when loading the form, and do a simple comparison against the change object that also get serialized. Something like a string comparison. Hope that make sense, Thanks

    Read the article

  • CakePHP Observe field for validation check(already exists)

    - by deck john
    i have already user observe field in cakephp 1.3 Now i want to do the same thing in cakephp 2.0 I have one form.there is a one field named email. When user insert email. onblur there is a popup one message that displays "email already exists" or "right" for that i have write below code in my projects. the below code is my add file code <?php $options = array('url' => array( 'controller' => 'users', 'action' => 'is_exist'), 'update' => 'email_exist'); echo $this->ajax->observeField('UserEmailId',array('url' => array( 'controller' => 'users', 'action' => 'is_exist'), 'update' => 'email_exists')); ?> In my controller i have created one function like public function is_exist($id = null) { $result = "yes"; $this->set('existdata',$result); } i have also created is_exists.ctp fiel in view/uers. i dont know why its not working. i did the same thing in Cakephp 1.3 and its working file but not in cakephp 2.0 can anyone tell me how i implement this ? thanks in advance

    Read the article

  • How to get result size from an SQL query and check size

    - by Jimmy
    Hi I'm trying to write a piece of code for a simple verification method as part of a MVC. At present the SQL is not written as a prepared statement so obviously it is at risk to a SQL injection so any help in regards to writing the SQL as a prepared statement would be really helpful. The method which is in the User model. public boolean getLoginInfo() { try { DBAccess dbAccess = new DBAccess(); String sql = "SELECT username, password FROM owner WHERE username = '" + this.username + "'AND password = '" + this.password + "';"; dbAccess.close();dbAccess.executeQuery(sql); dbAccess.close(); return true; } catch (Exception e) { return false; } } I want to get the size of the result set which is generated by the SQL query and if the size of it is 1 return true else it's false. If you need more info on the rest of the MVC just post and I'll get it up here.

    Read the article

< Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >