Posts

css - html multi select option how to mark selected options? -

i using normal select , mutliselect boxes on site. should use <option selected="selected"> or <option selected> selected items ? html5 spec : https://www.w3.org/tr/html5/forms.html#attr-option-selected the selected attribute boolean attribute. http://www.w3.org/tr/html5/infrastructure.html#boolean-attributes : the presence of boolean attribute on element represents true value, , absence of attribute represents false value. if attribute present, value must either empty string or value ascii case-insensitive match attribute's canonical name, no leading or trailing whitespace. conclusion : the following valid, equivalent , true : <option selected /> <option selected="" /> <option selected="selected" /> <option selected="selected" /> the following invalid : <option selected="0" /> <option selected="1" /> <option selected="fa...

ios - change date format in iPhone -

i trying since last 2 hours , finaly left out guys :p i need convert string mon, 14 may 2012, 12:00:55 +0200 date dd/mm/yyyy hh:ss format.. any kind of towards goal appreciated. what have tried i have tried using nsdateformatter unable figure out exact format of above date. [dateformatter setdateformat:@"eeeddmm,yyyy hh:mm:ss"]; how have tried , many other formats too eg: nsstring *finaldate = @"tue, 29 may 2012, 14:24:56 +0200"; nsdateformatter *dateformatter = [[nsdateformatter alloc] init]; [dateformatter setdateformat:@"eeeddmm,yyyy hh:mm:ss"]; nsdate *date = [dateformatter datefromstring:finaldate]; here date alwasys comes nil the important part of date formatting forgotten, tell nsdateformatter input language: nsdateformatter *dateformatter = [nsdateformatter new]; [dateformatter setdateformat:@"eee, dd mmmm yyyy, hh:mm:ss z"]; dateformatter.locale = [[nslocale alloc] initwithlocaleidentifier:@"...

Return int from dialog Android -

i have next code, i'm trying return value of "players" in method, based on user selection. problem can onclick method of dialog, idea? public int dialogoinicial(){ int players = 1; final string[] playersarray = {"1","2","3","4","5","6"}; alertdialog.builder dialog = new alertdialog.builder(this); dialog.settitle("nº "+getstring(r.string.players)+":"); dialog.setsinglechoiceitems(playersarray, -1, new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int player) { players = integer.parseint(playersarray[player]); } }); dialog.show(); return players; } this problem here return players executed while dialog being shown. simple solution make players variable class level variable instead of local variable function. can make function return void since won't able return anything. a...

c# - bind the button content which textbox has the cursor -

Image
i tried create on-screen keyboard. here want bind button content, textbox has cursor. public partial class current_cursor : window { public current_cursor() { this.initializecomponent(); } private void btn_a_click(object sender, routedeventargs e) { txt_diplay_1.text += btn_a.content; } } with above code can bind button content in first textbox. but can't bind value in textbox. please me. this implementation in wpf: <textbox height="23" margin="30,28,128,0" name="textbox1" verticalalignment="top" gotfocus="textbox1_gotfocus" /> <textbox height="23" margin="58,86,100,0" name="textbox2" verticalalignment="top" gotfocus="textbox2_gotfocus"/> backend: control ctrl = null; private void button1_click(object sender, routedeventargs e) { if (ctrl != null) { text...

ruby - Rails form_for own action routes -

i want modify action (submit) form_for helper <%= form_for(@rating, :as => :post, :url => demo_create_rating_path(@rating)) |f| %> <div class="field"> <%= f.label :value %><br /> <%= f.select :value, %w(1 2 3 4 5) %> </div> <%= f.hidden_field :article_id, :value => @article.id%> <%= f.hidden_field :user_id, :value => current_user.id %> <div class="field"> <%= f.label :description %><br /> <%= f.text_area :description, size: "100x5" %> </div> <div class="actions"> <%= f.submit %> </div> <% end %> this view , not work. all want is, can redirekt action after submit button error: actioncontroller::routingerror (no route matches {:controller=>"demo_ratings", :action=>"create", :article_id=>#<rating id: nil, value: nil, description: nil, article_id: nil, use...

.net - How to integrate httpRuntime maxRequestLength="8096" into app.config [Webservices] -

i have webservice waits xml arrive. today noticed, xml seems large. wanted add <httpruntime maxrequestlength="10096" usefullyqualifiedredirecturl="true" executiontimeout="120"/> app.config. unfortunately seems have no effect... here app.config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <httpruntime maxrequestlength="10096" usefullyqualifiedredirecturl="true" executiontimeout="120"/> </system.web> <system.servicemodel> <client /> <standardendpoints /> <services> <service behaviorconfiguration="metadatasupport" name="iib.wohnpreis.wohnpreisserver"> <host> <baseaddresses> <add baseaddress="urltowebservice" /> </baseaddresses> </host> </s...

php - Yii CGridView - Custom Columns -

been looking solution add feature "custom columns"... meaning, present list of columns can show user , selects ones wants see , after selection table updated , add/removes needed columns. didn't find on google (perhaps has different name looking for...) anyone has idea on how can accomplished? thanks in advance! this not complete sample, can give clues on how implement it. you've define kind of form collect data how grid has rendered. recommend create cformmodel class if there more 3 input fields. create view file form , div or renderpartial of file containing grid: $form = $this->beginwidget('cactiveformext'); echo $form->errorsummary($model); echo $form->labelex($model,'column1'); echo $form->dropdownlist($model echo $form->error($model,'column1'); echo chtml::ajaxsubmitbutton('updategrid',array('controller/grid'), array('update'=>'#grid'), ...