Search Results

Search found 316 results on 13 pages for 'blur'.

Page 3/13 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to keep submit button visible and executable upon textarea onblur

    - by ninumedia
    I have a <div id="comment_posting_holder"> tag that holds a form with two elements: a textarea box and a submit button. I want to have the div tag (containing the textarea and submit button) disappear if I click somewhere "OTHER" than the submit button. I have a start for the code below. So upon leaving focus from the textarea, I can make the div tag disappear. I tried placing in a mouseclick event inside the blur function for the submit button but that did not work. Any suggestions? Thank you! **Facebook does this with it's comments. If you click on a "Post your comment..." field the textarea appears and then it will disappear upon losing focus other than if you pressed the submit button. $('textarea').blur(function() { $('#comment_posting_holder).hide(); });

    Read the article

  • Inline-editing: onBlur prevents onClick from being triggered (jQuery)

    - by codethief
    Hello StackOverflow community! I'm currently working on my own jQuery plugin for inline-editing as those that already exist don't fit my needs. Anyway, I'd like to give the user the following (boolean) options concerning the way editing is supposed to work: submit_button reset_on_blur Let's say the user would like to have a submit button (submit_button = true) and wants the inline input element to be removed as soon as it loses focus (reset_on_blur = true). This leads to an onClick handler being registered for the button and an onBlur handler being registered for the input element. Every time the user clicks the button, however, the onBlur handler is also triggered and results in the edit mode being left, i.e. before the onClick event occurs. This makes submitting impossible. FYI, the HTML in edit mode looks like this: <td><input type="text" class="ie-input" value="Current value" /><div class="ie-content-backup" style="display: none;">Backup Value</div><input type="submit" class="ie-button-submit" value="Save" /></td> So, is there any way I could check in the onBlur handler if the focus was lost while activating the submit button, so that edit mode isn't left before the submit button's onClick event is triggered? I've also tried to register a $('body').click() handler to simulate blur and to be able to trace back which element has been clicked, but that didn't work either and resulted in rather strange bugs: $('html').click(function(e) { // body doesn't span over full page height, use html instead // Don't reset if the submit button, the input element itself or the element to be edited inline was clicked. if(!$(e.target).hasClass('ie-button-submit') && !$(e.target).hasClass('ie-input') && $(e.target).get(0) != element.get(0)) { cancel(element); } }); jEditable uses the following piece of code. I don't like this approach, though, because of the delay. Let alone I don't even understand why this works. ;) input.blur(function(e) { /* prevent canceling if submit was clicked */ t = setTimeout(function() { reset.apply(form, [settings, self]); }, 500); }); Thanks in advance!

    Read the article

  • modal popup extender as progress bar

    - by Anish Mohan
    Hi, I have a modal popup extender in which i have a progress bar. When i click a button ...this popup should be displayed to the user. I have done this though button.attributes.add().[ this is without postback] But ...popup extender can blur the base page only after the postback. Issue is currently i am able to see the progress bar...but base page is not blurred. :( Any help

    Read the article

  • Is it possible to smooth a scaled TBitmap in Delphi?

    - by Brian Frost
    I am using Stretched=True on a TBitmap with a 256x256 image. This gets scaled down by 1,2,4 or 8. As expected, text on the bitmap gets more horrible the more I depart from '1'. I notice though that Windows 7 explorer renders a scaled down version of the bitmap 'softer' and more pleasing. Is it possible to 'blur' a TBitmap in this way?

    Read the article

  • Why is android:FLAG_BLUR_BEHIND creating a gradient background in my new activity instead of bluring

    - by nderraugh
    Hi, I've got two activities. One is supposed to be a blur in front of the other. The background activity has several ImageViews which are set up as thin gradients extending across most of the screen and 10dip high. When I start the second activity it sets the background as a gradient occupying the entire window space, that is it appears to be fill_parent'd for both height and width. If I comment out the ImageViews then it blurs and looks as expected. Any thoughts? Here's the code doing the blur. import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.WindowManager; import android.view.View.OnClickListener; public class TransluscentBlurSummaryB extends Activity { @Override protected void onCreate(Bundle icicle) { super.onCreate(icicle); getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND, WindowManager.LayoutParams.FLAG_BLUR_BEHIND); getWindow().getAttributes().dimAmount = 0.5f; getWindow().setFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND, WindowManager.LayoutParams.FLAG_DIM_BEHIND); setContentView(R.layout.sheetbdetails); OnClickListener clickListener = new OnClickListener() { public void onClick(View v) { TransluscentBlurSummaryB.this.finish(); } }; findViewById(R.id.sheetbdetailstable).setOnClickListener(clickListener); } } And here's the layout with the ImageView gradients. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/summarysparent" > <!-- view1 goes on top --> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/view2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true"> <Button android:layout_height="wrap_content" android:id="@+id/ButtonBack" android:layout_width="wrap_content" android:text="Back" android:width="100dp"></Button> <Button android:layout_height="wrap_content" android:id="@+id/ButtonNext" android:layout_width="wrap_content" android:layout_alignParentRight="true" android:text="Start Over" android:width="100dp"></Button> </RelativeLayout> <TextView android:id="@+id/view1" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_width="wrap_content" android:layout_centerHorizontal="true" android:textSize="10pt" android:text="Summary"/> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/summaryscrollview" android:layout_below="@+id/view1" android:layout_above="@+id/view2"> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/summarydetails" > <!-- view2 goes on the bottom --> <TextView android:id="@+id/textview2" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_below="@+id/view1" android:layout_centerHorizontal="true" android:text="Recommended Child Support Order" android:layout_marginTop="10dip" /> <ImageView android:id="@+id/horizontalLine1" android:layout_width="fill_parent" android:layout_marginLeft="5dip" android:layout_marginRight="5dip" android:layout_height="10dip" android:src="@drawable/black_white_gradient" android:layout_below="@+id/textview2" android:layout_marginTop="10dip" /> <TextView android:id="@+id/textview3" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_below="@+id/horizontalLine1" android:layout_centerHorizontal="true" android:text="You" android:layout_marginTop="10dip" /> <TextView android:id="@+id/textview10" android:layout_height="wrap_content" android:layout_width="150dp" android:layout_below="@+id/textview3" android:layout_centerHorizontal="true" android:layout_marginTop="10dip" android:gravity="center_horizontal" /> <ImageView android:id="@+id/horizontalLine2" android:layout_width="fill_parent" android:layout_marginLeft="5dip" android:layout_marginRight="5dip" android:layout_height="10dip" android:src="@drawable/black_white_gradient" android:layout_below="@+id/textview10" android:layout_marginTop="10dip" /> <TextView android:id="@+id/textview4" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_below="@+id/horizontalLine2" android:layout_centerHorizontal="true" android:text="Other Parent" android:layout_marginTop="10dip" /> <TextView android:id="@+id/textview11" android:layout_height="wrap_content" android:layout_width="150dp" android:layout_below="@+id/textview4" android:layout_centerHorizontal="true" android:layout_marginTop="10dip" android:text="$536.18" android:gravity="center_horizontal" /> <ImageView android:id="@+id/horizontalLine3" android:layout_width="fill_parent" android:layout_marginLeft="5dip" android:layout_marginRight="5dip" android:layout_height="10dip" android:src="@drawable/black_white_gradient" android:layout_below="@+id/textview11" android:layout_marginTop="10dip" /> <TextView android:id="@+id/textview5" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_below="@+id/horizontalLine3" android:layout_centerHorizontal="true" android:text="Calculation Details" android:layout_marginTop="15dip" /> <ImageView android:id="@+id/infoButton" android:src="@drawable/ic_menu_info_details" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_below="@+id/horizontalLine3" android:layout_toRightOf="@+id/textview5" android:clickable="true" /> <ImageView android:id="@+id/horizontalLine4" android:layout_width="fill_parent" android:layout_marginLeft="5dip" android:layout_marginRight="5dip" android:layout_height="10dip" android:src="@drawable/black_white_gradient" android:layout_below="@+id/textview5" android:layout_marginTop="18dip" /> </RelativeLayout> </ScrollView> </RelativeLayout> The gradient drawable is this. <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor="#FFFFFF" android:centerColor="#000000" android:endColor="#FFFFFF" android:angle="270"/> <padding android:left="7dp" android:top="7dp" android:right="7dp" android:bottom="7dp" /> <corners android:radius="8dp" /> </shape> And here's the layout from the activity doing the blurring on top. <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/sheetbdetails" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true" > <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:scrollbars="vertical" android:shrinkColumns="0" android:id="@+id/sheetbdetailstable" > <TableRow> <TextView android:padding="3dip" /> <TextView android:text="You" android:padding="3dip" /> <TextView android:text="@string/otherparent" android:padding="3dip" /> <TextView android:text="Combined" android:padding="3dip" /> </TableRow> </TableLayout> </ScrollView> The transparent windows are themed from styles.xml in the apidemos using @style/Theme.Transparent.

    Read the article

  • Text rendering blurred in Firefox and Internet Explorer using jQuery

    - by Sixfoot Studio
    Not sure what causes this? If I user slideDown in Firefox the text rendering cuts off the top of the letters before the animation is complete. This is ok in IE. If I then change the animation to use fadeIn instead, the blur does not happen in Firefox but the text is very jagged in IE. From another question I have asked in the past pertaining to animation, the guy told me that I should wrap that which I want to animate in another DIV and animate that instead. This sorted out the jerkiness caused by the padding on the content inside the .animateDiv. Is there a trick to the text rendering as well in jQuery

    Read the article

  • Creating a semi-transparent blurred background WPF

    - by Dave Colwell
    Hi guys, I have a border, i want the background of this border to be partially transparent (opacity 0.8) but i do not want the image behind it to be well defined. The effect i am after is similar to the Windows Vista window border effect, where you can see that something is behind it but you cant tell what it is. A few clarifications: I am working on Windows XP, so i cant use Vista Glass I need this solution to be portable across any windows platform Any help would be appreciated :)

    Read the article

  • jquery onblur text

    - by Isis
    Hello <div id="servisesmenu"> <span class="services" title="???????">???????</span> </div> <div id="services_menu" class="hiddenmenu"> <div class="framemenu"> <div class="itemmenu"><a href="/flights_booking/" class="u" title="??????? ??????????? ??????">??????? ??????????? ??????</a></div> <div class="itemmenu"><a href="/hotels/" class="u" title="???????????? ???????? ??????">???????????? ???????? ??????</a></div> <div class="itemmenu"><a href="/sea_cruises_search/" class="u" title="????? ???????">????? ???????</a></div> <div class="itemmenu"><a href="/flights_panel/" class="u" title="????? ??????????">????? ??????????</a></div> </div> </div> $('.services').click(function() { $('#services_menu').attr('class') == 'hiddenmenu' ? $('#services_menu').attr('class', 'visiblemenu') : $('#services_menu').attr('class', 'hiddenmenu'); }); It's okay. But...How can I make by clicking on any place on the page, this field disappeared (class a hiddenmenu) Sorry for bad english. Thank you!

    Read the article

  • Why is my UIImageView blurred?

    - by Denis M
    I have a really weird problem with UIImageView. I have an image (an RGB png) 45x45 pixels which I add to the view. I can see that image is blurred after added to the view. Here is the same image in the simulator (left) and in Xcode (right): I have custom UIImageView class with this initWithImage code: - (id) initWithImage:(UIImage*) image { self = [super initWithImage:image]; self.frame = CGRectMake(0, 0, 45, 45); self.contentMode = UIViewContentModeScaleAspectFit; self.quantity = 1; if (self) { self.label = [[UITextField alloc]initWithFrame:CGRectMake(0,40,45,25)]; self.label.font = [UIFont systemFontOfSize:16]; self.label.borderStyle = UITextBorderStyleNone; self.label.enabled = TRUE; self.label.userInteractionEnabled = TRUE; self.label.delegate = self; self.label.keyboardType = UIKeyboardTypeNumbersAndPunctuation; self.label.textAlignment = UITextAlignmentCenter; } self.userInteractionEnabled = TRUE; // Prepare 3 buttons: count up, count down, and delete self.deleteButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; self.deleteButton.hidden = NO; self.deleteButton.userInteractionEnabled = YES; self.deleteButton.titleLabel.font = [UIFont systemFontOfSize:20]; self.deleteButton.titleLabel.textColor = [UIColor redColor]; [self.deleteButton setTitle:@"X" forState:UIControlStateNormal]; [self.deleteButton addTarget:self action:@selector(deleteIcon:) forControlEvents:UIControlEventTouchUpInside]; self.upCountButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; self.upCountButton.hidden = NO; self.upCountButton.userInteractionEnabled = YES; [self.upCountButton setTitle:@"+" forState:UIControlStateNormal]; [self.upCountButton addTarget:self action:@selector(addQuantity:) forControlEvents:UIControlEventTouchUpInside]; self.downCountButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; self.downCountButton.hidden = YES; self.downCountButton.userInteractionEnabled = YES; [self.downCountButton setTitle:@"-" forState:UIControlStateNormal]; [self.downCountButton addTarget:self action:@selector(removeQuantity:) forControlEvents:UIControlEventTouchUpInside]; return self; } I create it like this: UIImage *desertIcon = [UIImage imageNamed:@"desert.png"]; IconObj *desertIconView = [[IconObj alloc] initWithImage:desertIcon]; desertIconView.center = CGPointMake(265,VERTICAL_POINT_ICON); desertIconView.type = [IconObj TYPE_DESERT]; [self.view addSubview:desertIconView]; [desertIconView release]; Why would the displayed image be so than the one stored in a file?

    Read the article

  • iPhone Dev:Blurring of CALayers when rotated

    - by user153231
    Hello All, I have a CALayer with a png image as its content.When rotation is applied the layer looks blurry. I've searched for a cause for this problem and found out that the problem might be the half pixel problem, which makes the layer blurry if its frame.origin lays on fractions like 96.5, and they suggest to make the origin a whole number. Now, my layer's origin contains fractions because of the rotation i make as in: tempLayer.anchorPoint = CGPointMake(0.5,0.5); tempLayer.position = CGPointMake(200,100); tempLayer.bounds = CGRectMake(0,0,70,88); tempLayer.transform = CATransform3DMakeRotation(10.f*M_PI/180.f, 0.f, 0.f, 1.f); tempLayer.contents = (id)myImage; Basically i have three questions: 1) Is there a better way to rotate the layer? 2) The frame values are derived from the anchorPoint, position, bounds and transform values, how can i round my frame values to integer values and keep my rotation intact? 3) Can the CGRectIntegral function help me? If yes how? Thank you all in advance.

    Read the article

  • Why are the default UI controls in my iPhone app blurred?

    - by Tom H
    Why would the default iPhone interface elements, specifically the UISwitch (unmodified) and a UISegmentedControl appear slightly blurred? I have not changed them or called any private APIs. This blurring occurs when I run it both in the simulator and when I load it on my iPod Touch, so I don't think it's a one off drawing glitch. These elements were created via some code (initWithFrame:) not in interface builder. Here is a screenshot of the blurring in the simulator: http://drp.ly/14rS6a It looks similar on the actual device. Thanks for your help

    Read the article

  • Normal map lighting bug in bottom right quadrant

    - by Ryan Capote
    I am currently working on getting normal maps working in my project, and have run into a problem with lighting. As you can see, the normals in the bottom right quadrant of the lighting isn't calculating the correct direction to the light or something. Best seen by the red light If I use flat normals (z normal = 1.0), it seems to be working fine: normals for the tile sheet: Shader: #version 330 uniform sampler2D uDiffuseTexture; uniform sampler2D uNormalsTexture; uniform sampler2D uSpecularTexture; uniform sampler2D uEmissiveTexture; uniform sampler2D uWorldNormals; uniform sampler2D uShadowMap; uniform vec4 uLightColor; uniform float uConstAtten; uniform float uLinearAtten; uniform float uQuadradicAtten; uniform float uColorIntensity; in vec2 TexCoords; in vec2 GeomSize; out vec4 FragColor; float sample(vec2 coord, float r) { return step(r, texture2D(uShadowMap, coord).r); } float occluded() { float PI = 3.14; vec2 normalized = TexCoords.st * 2.0 - 1.0; float theta = atan(normalized.y, normalized.x); float r = length(normalized); float coord = (theta + PI) / (2.0 * PI); vec2 tc = vec2(coord, 0.0); float center = sample(tc, r); float sum = 0.0; float blur = (1.0 / GeomSize.x) * smoothstep(0.0, 1.0, r); sum += sample(vec2(tc.x - 4.0*blur, tc.y), r) * 0.05; sum += sample(vec2(tc.x - 3.0*blur, tc.y), r) * 0.09; sum += sample(vec2(tc.x - 2.0*blur, tc.y), r) * 0.12; sum += sample(vec2(tc.x - 1.0*blur, tc.y), r) * 0.15; sum += center * 0.16; sum += sample(vec2(tc.x + 1.0*blur, tc.y), r) * 0.15; sum += sample(vec2(tc.x + 2.0*blur, tc.y), r) * 0.12; sum += sample(vec2(tc.x + 3.0*blur, tc.y), r) * 0.09; sum += sample(vec2(tc.x + 4.0*blur, tc.y), r) * 0.05; return sum * smoothstep(1.0, 0.0, r); } float calcAttenuation(float distance) { float linearAtten = uLinearAtten * distance; float quadAtten = uQuadradicAtten * distance * distance; float attenuation = 1.0 / (uConstAtten + linearAtten + quadAtten); return attenuation; } vec3 calcFragPosition(void) { return vec3(TexCoords*GeomSize, 0.0); } vec3 calcLightPosition(void) { return vec3(GeomSize/2.0, 0.0); } float calcDistance(vec3 fragPos, vec3 lightPos) { return length(fragPos - lightPos); } vec3 calcLightDirection(vec3 fragPos, vec3 lightPos) { return normalize(lightPos - fragPos); } vec4 calcFinalLight(vec2 worldUV, vec3 lightDir, float attenuation) { float diffuseFactor = dot(normalize(texture2D(uNormalsTexture, worldUV).rgb), lightDir); vec4 diffuse = vec4(0.0); vec4 lightColor = uLightColor * uColorIntensity; if(diffuseFactor > 0.0) { diffuse = vec4(texture2D(uDiffuseTexture, worldUV.xy).rgb, 1.0); diffuse *= diffuseFactor; lightColor *= diffuseFactor; } else { discard; } vec4 final = (diffuse + lightColor); if(texture2D(uWorldNormals, worldUV).g > 0.0) { return final * attenuation; } else { return final * occluded(); } } void main(void) { vec3 fragPosition = calcFragPosition(); vec3 lightPosition = calcLightPosition(); float distance = calcDistance(fragPosition, lightPosition); float attenuation = calcAttenuation(distance); vec2 worldPos = gl_FragCoord.xy / vec2(1024, 768); vec3 lightDir = calcLightDirection(fragPosition, lightPosition); lightDir = (lightDir*0.5)+0.5; float atten = calcAttenuation(distance); vec4 emissive = texture2D(uEmissiveTexture, worldPos); FragColor = calcFinalLight(worldPos, lightDir, atten) + emissive; }

    Read the article

  • How to get the Blur event to fire for the document on the iPhone?

    - by Ian Storm Taylor
    Does anyone know how to get the blur event to fire on the document for the iPhone? I'm trying to get it to fire either when a user changes windows in Safari, or when they open their bookmarks or when they decide to add the page to their homescreen. But none of these are firing it. Here's my code: $(document).blur( function () { document.title = "Ian Taylor"; }); I've tried "document", "window", "'body'". Nothing seems to work.

    Read the article

  • Fragment-shader blur ... how does this work?

    - by anon
    uniform sampler2D sampler0; uniform vec2 tc_offset[9]; void blur() { vec4 sample[9]; for(int i = 0; i < 9; ++i) sample[i] = texture2D(sampler0, gl_TexCoord[0].st + tc_offset[i]); gl_FragColor = (sample[0] + (2.0 * sample[1]) + sample[2] + (2.0 * sample[3]) + sample[4] + 2.0 * sample[5] + sample[6] + 2.0 * sample[7] + sample[8] ) / 13.0; } How does the sample[i] = texture2D(sample0, ...) line work? It seems like to blur an image, I have to first generate the image, yet here, I'm somehow trying to query the very iamge I'm generating. How does this work?

    Read the article

  • How to programmatically blur an area in a movie (in python) ?

    - by Stefano Borini
    I have a movie, and I want to produce a new movie out of it with an area blurred (e.g. an object, a writing or a face). The area is moving, so I must have fine control of the current frame and move the position of the blur area accordingly. Blur is an option, but also a dark mask is fine too. Now, I have a question open at superuser on which software to use, but since I suspect I will have to buy adobe premiere to do something like this, and I don't want to shell out a kidney for something I have to do once, I am thinking about coding it myself in python. What are the best libraries available for this task ?

    Read the article

  • How do I blur (ios7 style) a section of an image in a UITableViewCell?

    - by George McKibbin
    I've got a UIImageView that takes up the whole cell and shows an image. I'd like to blur the bottom third of the view in the iOS7 style (we're targeting iOS7). There will be a label over the blurred part. The issue seems to be that I can't "screenshot" the UIImageView right as I am setting up the cell in tableView:cellForRowAtIndexPath: as it hasn't loaded yet. Although i've even tried setting up a timer for a 0.1 second delay and that also doesn't work. I've tried the stuff on http://damir.me/posts/ios7-blurring-techniques I've tried https://github.com/justinmfischer/7blur I'd like to use the new screenshotting API drawViewHierarchyInRect:afterScreenUpdates: I'd also like to use apple's sample code UIImage+ImageEffects The only thing that has worked so far has been to just put a UIToolbar in but the performance is really slow. I don't need dynamic updates. I've managed to get the following effect a few times but it has just tinted the view and hasn't actually blurred anything so I'm a bit confused.

    Read the article

  • Actionscript blur/shadows/glows how heavy are they on the processor?

    - by Fahim Akhter
    Hi, I have say 10 items in a particular space, If I apply glows and drop shadows to all of them and all of these items are usually static. Other characters do move around them too. So I'm just wondering would it be wise to use vectors with actionscript blurs and glows. Or to have a PNG? and if I cannot have a PNG and have to work with vectors with glows/blurs/shadows. Would they be too heavy on the processor?

    Read the article

  • Form Field: How do I change the background on blur?

    - by Liso22
    I managed to remove the background when the user clicks on the field but I cannot restore it when it blurs! This is the field: <textarea class="question-box" style="width: 240px; background: white url('http://chusmix.com/Imagenes/contawidget.png') no-repeat 50% 50%; color: grey;" cols="12" rows="5" id="question-box-' . $questionformid . '" name="title" onblur="if(this.value == '') { this.style.color='#848484'; this.value=''this.style.background=' white url('http://chusmix.com/Imagenes/contawidget.png') no-repeat 50% 50%;e';}" onfocus="if (this.value == '') {this.style.color='#444'; this.style.background='none';}" type="text" maxlength="200" size="28"></textarea> Anyone knows what I'm doing wrong?? Thanks

    Read the article

  • Is realtime validation of username good or bad?

    - by iamserious
    I have a simple form for the user to sign up to my site; with email, username and password fields. We are now trying to implement an ajax validation so the user doesn't have to post the form to find out if the username is already taken. I can do this either on keyup event or on text blur event. My question is, which of these is really the best way to do? Keyup From the user POV, it would be good if the validation is done as and when they are typing, (on key up event) - of course, I am waiting for half a second to see if the user stops typing before firing off the request, and user can make any adjustments immediately. But this means I am sending way more requests than if I validated the username on Blur event. Blur The number of requests will be much lower when the validation is done on blur event, But this means the user has to actually go away from the textbox, look at the validation result, and if necessary go back to it to make any changes and repeat the whole process until he gets it right. I had a quick look at google, tumblr, twitter and no one actually does username validations on keyup events, (heck, tubmlr waits for the form to be posted) but I can swear I have seen keyup validations in a lot of places too. So, coming back to the question, will keyup validations be too many for server, is it an unnecessary overhead? or is it worth taking these hits to give user a better experience? ps: all my regex validations etc are already done on javascript and only when it passes all these other criteria does it send a request to server to check if a username already exists. (And the server is doing a select count(1) from user where username = '' - nothing substantial, but still enough to occupy some resource) pps: I'm on asp.net, MS SQL stack., if that matters.

    Read the article

  • Where ORMs blur the lines between code and data, how do you decide what logic should be a stored procedure, and what should be coded?

    - by PhonicUK
    Take the following pseudocode: CreateInvoiceAndCalculate(ItemsAndQuantities, DispatchAddress, User); And say CreateInvoice does the following: Create a new entry in an Invoices table belonging to the specified User to be sent to the given DispatchAddress. Create a new entry in an InvoiceItems table for each of the items in ItemsAndQuantities, storing the Item, the Quantity, and the cost of the item as of now (by looking it up from an Items table) Calculate the total amount of the invoice (ex shipping and taxes) and store it in the new Invoice row. At a glace you wouldn't be able to tell if this was a method in my applications code, or a stored procedure in the database that is being exposed as a function by the ORM. And to some extent it doesn't really matter. Now technically none of this is business logic. You're not making any decisions - just performing a calculation and creating records. However some may argue that because you are performing a calculation that affects the business (the total amount to be invoiced) that this isn't something that should be done in a stored procedure and instead should be in code. So for this specific example - why would it be more appropriate to do one or the other? And where do you draw the line? Or does it even particular matter as long as it's sufficiently well documented?

    Read the article

  • JQuery Validation Plugin: Use Custom Ajax Method

    - by namtax
    Hi Looking for some assistance with the Jquery form validation plugin if possible. I am validating the email field of my form on blur by making an ajax call to my database, which checks if the text in the email field is currently in the database. // Check email validity on Blur $('#sEmail').blur(function(){ // Grab Email From Form var itemValue = $('#sEmail').val(); // Serialise data for ajax processing var emailData = { sEmail: itemValue } // Do Ajax Call $.getJSON('http://localhost:8501/ems/trunk/www/cfcs/admin_user_service.cfc?method=getAdminUserEmail&returnFormat=json&queryformat=column', emailData, function(data){ if (data != false) { var errorMessage = 'This email address has already been registered'; } else { var errorMessage = 'Good' } }) }); What I would like to do, is encorporate this call into the rules of my JQuery Validation Plugin...e.g $("#setAdminUser").validate({ rules:{ sEmail: { required: function(){ // Replicate my on blur ajax email call here } }, messages:{ sEmail: { required: "this email already exists" } }); Wondering if there is anyway of achieving this? Many thanks

    Read the article

  • JQuery live function doesn't work

    - by Sayem Ahmed
    I have some text boxes, all of which have the same class "addExamNumberBoxStyle". Now I want to bind a "blur" handler to each one of these. When I use direct "blur" event like below - $('.addExamNumberBoxStyle').blur(function() { alert("Hello World"); }); it works perfectly. But when I use "live" function like below - $('.addExamNumberBoxStyle').live('blur', function() { alert("Hello World"); }); it does not work. Why?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >