value

[django] How do I override a default value of a form?

Can someone help me here? My form looks like this: class RecieveLineForm(forms.ModelForm): purchaseorderline = forms.IntegerField(widget=forms.HiddenInput()) rl_quantity = forms.IntegerField(label='Quantity') class Meta: model = RecieveLine Now, I need to set a default value for my purchaseorderline which is origi...

Useing Registry value to launch a application? whats wrong with it? .net 2.0 ONLY please

I am trying to write a little piece of code that retrieves the install path of an application, and uses it + the applications name to start the application on click. This is what I have so far but I keep getting the error "Object reference not set to an instance of an object". This is the code I'm trying to use, whats wrong? RegistryKey...

dealloc all constant values used at final view controller

Hi friends, I am working in login/logout from my current application in iphone sdk. I am using many constant value in my application in various view controller. is it possible dealloc all values at final view controller? Any suggestions? Thanks in advance Regards, sathish ...

How to get HTML <textarea> value using c# ?

How can I get the value of a textarea using c# ? my issue is when I using MultiLine TextBox I can't get the full value !! I mean what I wrote including the breake lines. ex: Google Micrisoft Yahoo after saving above data it come's in one line 1.Google 2.Microsoft 3.Yahoo ...

Can't change a value inside a php list

Hi everybody, I have the following php loop that takes an array that contains a set of arrays, then I convert each array to a list to manipulate more accurately the elements. while ($i<sizeof($my_array)){ while(list($key,$val) = each($my_array[$i])){ $j = $i+1; if ($key == "fruit"){ $val = "ananas".$j; ...

Send Div id to javascript via onclick

Hello, I have a page with several div's. All of the divs have a unique id. I would like to send that id to a javascript function. I have tried to save it as a value as well, and send this.value, but that does not work either. <div class='recordElem$val' id='$rname' value='$rname' onclick='javascript:updateRecord(this.value);'> ...

Finding checkbox value, writing to XML result

Hi, I'm creating a weekly HTML email writing template (hence the weird file name) and I'm using ASP and XML as the backend. The XML is prefect but the ASP isn't.. What I'm going for here is to create an XMl node that has a value of notchecked and checked depending on if the checkbox on the form is checked or not. I've tried using If ...

WPF ListBoxItem with value ?

Hi ! I would like you to ask if it is somehow possible to provide in the ListBoxItem the string that will appear and the value to be stored in DB. This is indeed possible: ItemSource={Binding MyEnumColleciton} or ItemSource={DynamicResource MyCollection} etc.. but if you image that I have about 100 ListBoxes .. I don't want to hav...

Problem with setting a value

Here is my code snippit: - (void) getData: (NSNotification *)aNotification{ NSData *data = [[aNotification userInfo] objectForKey:NSFileHandleNotificationDataItem]; if ([data length]) { return [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]; } else { [self stopProcess]; } [[aNotification objec...

Set minimum value of MySQL field - possible?

Quick newbie MySQL question. What would be the simplest way to ensure that the minimum value of a given field is 0? Basically, we have a script that runs automatically and subtracts an integer value from the value of a field every 15 minutes--but we want any entry that gets to 0 to stay at 0 and not go negative. This could be simply d...

jQuery val() opens keyboard

Hello, I am using jqTouch for my web app which is running on different phones including the iPhone. The issue I have is with the iPhone. When I set a value on the form using the jQuery function val(), the keyboard opens up automatically. I don't want that to happen when I am changing the value or just adding a default value to a pre-ex...

Function returning a tuple or None: how to call that function nicely?

Hello, Suppose the following: def MyFunc(a): if a < 0: return None return (a+1, a+2, a+3) v1, v2, v3 = MyFunc() # Bad ofcourse, if the result was None What is the best way to define a function that returns a tuple and yet can be nicely called. Currently, I could do this: r = MyFunc() if r: v1, v2, v3 = r else: # bad!! ...

simplest way to return a new list by remove index/value from another list? (order required)

All, o1 = ["a","b","c","d","e","f","g","h"] index = [3,4] value = ["c","d"] [x for x in o1 if x not in value] [x for x in o1 if x not in [o1[y] for y in index]] any simpler solution for above lc? Thanks ...

Receive all values for input[] in array form in jQuery to send to PHP script

Hi there I am busy getting values on a form using jQuery to send to my PHP script. Well, most of my checkboxes have a name in the form of name="input[]" and so when I alert the value that gets returned in my form's submit() handler, it only returns the value of the first checkbox with that name. How can I return the values in array form...

Passing and receiving routedictionary values in mvc2

I have a link in my action like this <%: Html.ActionLink("View Data","Index","MyItem", new {itemId=Model.itemId}, null)%> now in my newItem controller in its index action how do I retrieve this itemId, so far I have tried this public ActionResult Index() { RouteData rd = this.RouteData; var list = from...

Can we recognise '%' & 'px' in jQuery ?

When reading width of DIV section, the result comes in %. But, I want to convert it in pixel value. How is it possible ? I have a class "h" defined in my html. It has width="100%". It's parent div has width="69%". width = ($(this).find('.h').width()) So actually the width is not window.width() but it is 69% of it. I want it in pixel ...

Setting values in SWF, Cocoa?

Hi, I am trying to set values for a SWF file. I have the SWF in a web view, but I need to set values for it. How would I set values for it? Thanks. ...

iPhone UISlider to NSNumber

Hi All, I'm trying to get the value of a UISlider and store it into part of a CoreData entity. The score I need to save will either be the value of the slider (i.e. slider.value) or 10 minus the value of the slider (i.e. 10 - slider.value) I'm trying to put it into an NSNumber and when I use the intValue it works fine. When I use eit...

Setting label and value of the chart

I'm creating pie charts using JFreeChart, and I want to set the value and the label seperately like in iReport, how can I do this? In other words, I want the chart to show different results on the pie than in the legend. ...

Gethashcode() function

Why aren't C1 and c2 have the same hashcode ? the code doesn't get to "Same".... ( i=0 in both classes) class myclass { public static int i; static void Main() { myclass c1 = new myclass(); myclass c2 = new myclass(); if (c1.GetHashCode() == c2.GetHashCode()) Console.Write("Same"); ...