Search Results

Search found 6055 results on 243 pages for 'forms'.

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

  • Auto insert date and time in form input field?

    - by Mo Boho
    Using javascript, how can we auto insert the current DATE and TIME into a form input field. I'm building a "Problems" form to keep track of user submitted complaints about a certain service. I'm collecting as much info as possible. I want to save the staff here from having to manually enter the date and time each time they open the form. I have this snippet of code: <input id="date" name="date" value="javascript:document.write(Date()+'.')"/> but it's not working. many thanks for any help.

    Read the article

  • Automatically select option from select menu with link

    - by Ben
    Hello there, I am trying to use php (and if not php, javascript) to link to a page and include a "?type=foo" or "#foo" at the end of the link so that when the linked page loads it will automatically select a specific option, depending on the end of the link, from a dropdown menu in a form. I have tried to search for this but do not know what this action is actually called, but I've seen it done before. Does anyone know how to achieve this? Thanks very much.

    Read the article

  • MS Access form_current() firing multiple times

    - by Eric G
    I have a form with two subforms (on separate tab pages). It's an MDB project in Access 2003. When it initially opens, Form_Current on the active subform fires once, as it should. But when you move to another record (ie. from the main form), it fires Form_Current on the active subform 4 times. Then subsequent record-moves result in Form_Current firing 2 times. This is a pain, because the subforms have a lot of fields that get moved and/or hidden and so it jumps around for every Form_Current, not to mention being slow. I am opening the form with a filter via DoCmd.OpenForm (actually it sends the filter in via OpenArgs). FilterOn is only set once, in Form_Open on the main form, never in the subforms. Form_Current is not called explicitly anywhere else in the code. When I look at the call stack when Form_Current fires moving the first time, it looks like: my_subform.Form_Current [<Debug Window>] my_subform.Form_Current So it seems like something in Form_Current is triggering another Form_Current event. But only on the first record move. The code in Form_Current is somewhat complex, involving custom classes and event callbacks, but generally does not touch the table data. The only thing I can think might be triggering a Form_Current is that it checks OldValue on form controls - could this be causing it? Or anything else come to mind? Thanks. Eric

    Read the article

  • cgi.FieldStorage translating unicode strangely

    - by trydyingtolive
    I have a form that is on a UTF-8 encoded page. When I submit the form cgi.FieldStorage converts any non-ascii character to an odd format. For example if I submit the value c. The browser will send %c4%87. I want to convert that to the string \xc4\x87. However, cgi.FieldStorage is converting it to \\xc4\\x87. post = cgi.FieldStorage(fp=env['wsgi.input'], environ=env, keep_blank_values=True) Python 2.6 on Ubuntu 9.10SE, Apache2, mod_wsgi.

    Read the article

  • Android Form Design Overlaping

    - by Mashfuk
    In My Project I have to built a registration form like the following. But when I design the form it overlays some item. How can I easily design registration form in android. How can I solve this? Thanks in advanced. <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ScrollView1" android:layout_width="fill_parent" android:layout_height="fill_parent" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#FFFFFF" > <TextView android:text="Registration Form" android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content"> </TextView> <View android:layout_below="@id/textView1" android:background="#000000" android:layout_height="1dp" android:id="@+id/view1" android:layout_width="fill_parent" > </View> <!-- Child Menu Section of Registration Form --> <RelativeLayout android:layout_below="@id/textView1" android:id="@+id/rlKidsMenuRegForm" android:layout_height="wrap_content" android:layout_width="fill_parent" > <TextView android:layout_alignParentLeft="true" android:text="Do you use the kids MENU?" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/textView2"> </TextView> <EditText android:layout_toRightOf="@id/textView2" android:textSize="10sp" android:layout_height="15dp" android:text="EditText" android:id="@+id/editText1" android:layout_width="wrap_content"> </EditText> <EditText android:layout_height="wrap_content" android:text="EditText" android:textSize="10sp" android:id="@+id/editText2" android:layout_width="wrap_content" android:layout_below="@id/editText1"> </EditText> <EditText android:layout_toRightOf="@id/editText2" android:layout_below="@id/editText1" android:layout_height="wrap_content" android:textSize="10sp" android:text="EditText" android:id="@+id/editText3" android:layout_width="wrap_content"> </EditText> <View android:layout_below="@id/editText3" android:background="#000000" android:layout_height="1dp" android:id="@+id/view1" android:layout_width="fill_parent" > </View> </RelativeLayout> <!-- Mid Section of Registration Form --> <RelativeLayout android:layout_below="@id/rlKidsMenuRegForm" android:id="@+id/rlMidRegForm" android:layout_height="wrap_content" android:layout_width="fill_parent" android:background="#FFFFFF" > <EditText android:layout_alignParentLeft="true" android:layout_height="wrap_content" android:text="EditText" android:id="@+id/editText4" android:layout_width="wrap_content"> </EditText> <EditText android:layout_height="wrap_content" android:text="EditText" android:id="@+id/editText5" android:layout_width="wrap_content" android:layout_toRightOf="@id/editText4"> </EditText> <TextView android:text="TextView" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_width="fill_parent" android:id="@+id/textView3" android:layout_below="@id/editText5" > </TextView> <EditText android:layout_height="wrap_content" android:text="EditText" android:id="@+id/editText5" android:layout_width="fill_parent" android:layout_below="@id/textView3"> </EditText> <TextView android:text="TextView" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_width="fill_parent" android:layout_below="@id/editText5" android:id="@+id/textView3" > </TextView> <TextView android:text="TextView" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_width="wrap_content" android:id="@+id/textView3" android:layout_below="@id/textView3" > </TextView> </RelativeLayout> </RelativeLayout> </ScrollView>

    Read the article

  • How to create a view to manage associations between HABTM models? (Rails)

    - by Chris Hart
    Hello, I am using Ruby on Rails and need to create a view that allows the creation of records through a HABTM relationship to another model. Specifically, I have the following models: Customer and ServiceOverride, and a join table customers_serviceoverrides. Using the customer view for create/update, I need to be able to create, update and delete ServiceOverrides and manage the attributes of the associated model(s) from the same view. Visually I'd prefer to have something like a plus/minus sign to add/delete service overrides, and each serviceoverride record has two string entities which need to be displayed and editable as well. However, if I could just get the code (a kind of nested form, I'm assuming?) working, I could work out the UI aspects. The models are pretty simple: class ServiceOverride < ActiveRecord::Base has_and_belongs_to_many :customers end class Customer < ActiveRecord::Base has_and_belongs_to_many :serviceoverrides end The closest thing I've found explaining this online is on this blog but it doesn't really address what I'm trying to do (both manage the linkages to the other model, and edit attributes of that model. Any help is appreciated. Thanks in advance. Chris

    Read the article

  • nested form collection_select new value overwriting previous selected values

    - by bharath
    Nested form <%= nested_form_for(@bill) do |f| %> <p><%= f.link_to_add "Add Product", :bill_line_items %> </p> Partial of bill line items <%= javascript_include_tag 'bill'%> <%= f.hidden_field :bill_id %> <%- prices = Hash[Product.all.map{|p| [p.id, p.price]}].to_json %> <%= f.label :product_id %> <%= f.collection_select :product_id ,Product.all,:id,:name, :class => 'product', :prompt => "Select a Product", input_html: {data: {prices: prices}}%> <br/ > <%= f.label :price, "price"%> <%= f.text_field :price, :size=>20, :class =>"price" %><br/> bill.js jQuery(document).ready(function(){ jQuery('.product').change(function() { var product_id = jQuery(this).val(); var price = eval(jQuery(this).data("prices"))[product_id]; jQuery('.price').val(price); }); }); Rails 3.2 Issue: Second click on Add Product & on selecting the product When we select the second product the price of second product is overwriting on the price of the first selected product. Request help.

    Read the article

  • Passing variables across a multi page form in php

    - by Chris
    Forgive me as I am a newbie. I have a multi page form in which I am using $_SESSIONS to record the variables. <?php session_start(); foreach ( $_POST as $key=>$value ) { if ( $key!="submit" ) { $value= htmlentities(stripslashes(strip_tags($value))); $_SESSION[$key] = $value; } }` I have two problems actually. When I get to a checkform.php that I made that prints out the variables, The variables from page 1 doesn't show up even though that code listed above is on each page. I am using Firefox web developers tool to disable cookies and in the php ini, I altered session.use_trans_sid to 1 to turn it on. For the final page on my checkform.php I print_r($_POST) for the final page which works fine. Why doesn't variables from page 1 not show up? What am I missing? The 2nd problem is that when I print_r($_SESSION), some fields, specifically the checkbox arrays, print as [payment] => Array [agerange] => Array [meals] => Array [mealtypes] => Array What am I missing?

    Read the article

  • firebug saying not a function

    - by Aaron
    <script type = "text/javascript"> var First_Array = new Array(); function reset_Form2() {document.extraInfo.reset();} function showList1() {document.getElementById("favSports").style.visibility="visible";} function showList2() {document.getElementById("favSubjects").style.visibility="visible";} function hideProceed() {document.getElementById('proceed').style.visibility='hidden';} function proceedToSecond () { document.getElementById("div1").style.visibility="hidden"; document.getElementById("div2").style.visibility="visible"; document.getElementById("favSports").style.visibility="hidden"; document.getElementById("favSubjects").style.visibility="hidden"; } function backToFirst () { document.getElementById("div1").style.visibility="visible"; document.getElementById("div2").style.visibility="hidden"; document.getElementById("favSports").style.visibility="visible"; document.getElementById("favSubjects").style.visibility="visible"; } function reset_Form(){ document.personalInfo.reset(); document.getElementById("favSports").style.visibility="hidden"; document.getElementById("favSubjects").style.visibility="hidden"; } function isValidName(firstStr) { var firstPat = /^([a-zA-Z]+)$/; var matchArray = firstStr.match(firstPat); if (matchArray == null) { alert("That's a weird name, try again"); return false; } return true; } function isValidZip(zipStr) { var zipPat =/[0-9]{5}/; var matchArray = zipStr.match(zipPat); if(matchArray == null) { alert("Zip is not in valid format"); return false; } return true; } function isValidApt(aptStr) { var aptPat = /[\d]/; var matchArray = aptStr.match(aptPat); if(matchArray == null) { if (aptStr=="") { return true; } alert("Apt is not proper format"); return false; } return true; } function isValidDate(dateStr) { //requires 4 digit year: var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/; var matchArray = dateStr.match(datePat); if (matchArray == null) { alert("Date is not in a valid format."); return false; } return true; } function checkRadioFirst() { var rb = document.personalInfo.salutation; for(var i=0;i<rb.length;i++) { if(rb[i].checked) { return true; } } alert("Please specify a salutation"); return false; } function checkCheckFirst() { var rb = document.personalInfo.operatingSystems; for(var i=0;i<rb.length;i++) { if(rb[i].checked) { return true; } } alert("Please specify an operating system") ; return false; } function checkSelectFirst() { if ( document.personalInfo.sports.selectedIndex == -1) { alert ( "Please select a sport" ); return false; } return true; } function checkRadioSecond() { var rb = document.extraInfo.referral; for(var i=0;i<rb.length;i++) { if(rb[i].checked) { return true; } } alert("Please select form of referral"); return false; } function checkCheckSecond() { var rb = document.extraInfo.officeSupplies; for(var i=0;i<rb.length;i++) { if(rb[i].checked) { return true; } } alert("Please select an office supply option"); return false; } function checkSelectSecond() { if ( document.extraInfo.colorPick.selectedIndex == 0 ) { alert ( "Please select a favorite color" ); return false; } return true; } function check_Form(){ var retvalue = isValidDate(document.personalInfo.date.value); if(retvalue) { retvalue = isValidZip(document.personalInfo.zipCode.value); if(retvalue) { retvalue = isValidName(document.personalInfo.nameFirst.value); if(retvalue) { retvalue = checkRadioFirst(); if(retvalue) { retvalue = checkCheckFirst(); if(retvalue) { retvalue = checkSelectFirst(); if(retvalue) { retvalue = isValidApt(document.personalInfo.aptNum.value); if(retvalue){ document.getElementById('proceed').style.visibility='visible'; var rb = document.personalInfo.salutation; for(var i=0;i<rb.length;i++) { if(rb[i].checked) { var salForm = rb[i].value; } } var SportsOptions = ""; for(var j=0;j<document.personalInfo.sports.length;j++){ if ( document.personalInfo.sports.options[j].selected){ SportsOptions += document.personalInfo.sports.options[j].value + " "; } } var SubjectsOptions= ""; for(var k=0;k<document.personalInfo.subjects.length;k++){ if ( document.personalInfo.subjects.options[k].selected){ SubjectsOptions += document.personalInfo.subjects.options[k].value + " "; } } var osBox = document.personalInfo.operatingSystems; var OSOptions = ""; for(var y=0;y<osBox.length;y++) { if(osBox[y].checked) { OSOptions += osBox[y].value + " "; } } First_Array[0] = salForm; First_Array[1] = document.personalInfo.nameFirst.value; First_Array[2] = document.personalInfo.nameMiddle.value; First_Array[3] = document.personalInfo.nameLast.value; First_Array[4] = document.personalInfo.address.value; First_Array[5] = document.personalInfo.aptNum.value; First_Array[6] = document.personalInfo.city.value; for(var l=0; l<document.personalInfo.state.length; l++) { if (document.personalInfo.state.options[l].selected) { First_Array[7] = document.personalInfo.state[l].value; } } First_Array[8] = document.personalInfo.zipCode.value; First_Array[9] = document.personalInfo.date.value; First_Array[10] = document.personalInfo.phone.value; First_Array[11] = SportsOptions; First_Array[12] = SubjectsOptions; First_Array[13] = OSOptions; alert("Everything looks good."); document.getElementById('validityButton').style.visibility='hidden'; } } } } } } } } /*function formAction2() { var retvalue; retvalue = checkRadioSecond(); if(!retvalue) { return retvalue; } retvalue = checkCheckSecond(); if(!retvalue) { return retvalue; } return checkSelectSecond() ; } */ </script> This is just a sample of the code, there are alot more functions, but I thought the error might be related to surrounding code. I have absolutely no idea why, as I know all the surrounding functions execute, and First_Array is populated. However when I click the Proceed to Second button, the onclick attribute does not execute because Firebug says proceedToSecond is not a function button code: <input type="button" id="proceed" name="proceedToSecond" onclick="proceedToSecond();" value="Proceed to second form">

    Read the article

  • CakePHP form $options['options']

    - by James
    Hey! Total CakePHP noob here. This is sort of a two fold question. In a view that is used for adding user objects I would like to use a drop down (selection) field in the form. Each user belongs to a group so when I add a user I want a drop down that contains all of the groups that the user could possibly join. Currently the group_id field is a textfield. I know how to force it to be a selection field, but I don't know how to populate the selection with the names of the groups programmatically. The Current method: echo $form->input('group_id', array( '1' => 'NameOfGroup1', '2' => 'NameOfGroup2', '3' => 'NameOfGroup3') ); I want to generate the options array programmatically though. echo $form->input('group_id', $this->Group->find('list')); This doesn't work though. I get an error: Undefined property: View::$Group [APP/views/users/add.ctp, line 8] To me this means that I don't have access to the Group object from inside my user view. How can I accomplish this? Again, I want to do it programmatically so that it updates as I add groups or remove them.

    Read the article

  • How to elegantly handle ReturnUrl when using UrlRewrite in ASP.NET 2.0 WebForms

    - by Brian Kim
    I have a folder with multiple .aspx pages that I want to restrict access to. I have added web.config to that folder with <deny users="?"/>. The problem is that ReturnUrl is auto-generated with physical path to the .aspx file while I'm using UrlRewrite. Is there a way to manipulate ReturnUrl without doing manual authentication check and redirection? Is there a way to set ReturnUrl from code-behind or from web.config? EDIT: The application is using ASP.NET 2.0 WebForms. I cannot use 3.5 routing. EDIT 2: It seems like 401 status code is never captured. It returns 302 for protected page and redirects to login page with ReturnUrl. It does not return 401 for protected page. Hmm... Interesting... Ref: http://msdn.microsoft.com/en-us/library/aa480476.aspx This makes things harder... I might have to write reverse rewrite mapping rules to regex match ReturnUrl and replace it if it doesn't return 401... If it does return 401 I can either set RawUrl to Response.RedirectLocation or replace ReturnUrl with RawUrl. Anyone else have any other ideas?

    Read the article

  • sfJQueryUIPlugin: No Picker for new records

    - by Prasad
    Everyday is a new day with Symfony, but I'm loving it! This morning I installed the sfJQueryUIPlugin. It has very little dependencies & accepts themeRoller styles. However, it has 2 issues: [Feature_Request] There is no way to specify the year range. By default, it shows a 20 year range around the year in the field value. eg. if field value is 1993-01-20, the range will be 1983 to 2003. ??? Has anyone found a way out??? The DatePicker does not appear when the field is empty, Thus it does not show up during new record creation. To solve this, I tried setting up the default value in the date input field (which now appears as a text input) using $this->setDefault('date_of_birth',date('Y-m-d')); ??? Is anybody facing this problem of picker now available during new record creation ??? ??? Also is it the right way to set default value ??? Thanks in advance.

    Read the article

  • Rails Multiple Models per Form, Optional FK Association

    - by ckarbass
    Given the following pseudo-code: Company has_many :jobs Job belongs_to :company I'm creating a form to post a new job. In the form, I want to have two fields for an optional company. On submission, if a company was entered, I want to either create or update the company and associate it with the new job. I know if the company exists by searching the companies table for the company's url. Is it possible to do this using form_for, fields_for, and accepts_nested_attributes_for given the company may not exist?

    Read the article

  • MouseEnter and MouseLeave events from a Panel and it's child controls

    - by DxCK
    I have a Panel that contains child controls. If i handling the Panel's MouseEnter and MouseLeave events, and his child's MouseEnter and MouseLeave events, here is the order or raising: Panel.MouseEnter Panel.MouseLeave Child1.MouseEnter Child1.MouseLeave Panel.MouseEnter Panel.MouseLeave but i need the following order of raising: Panel.MouseEnter Child1.MouseEnter Child1.MouseLeave Panel.MouseLeave Is that possible?

    Read the article

  • Why do I get a AssociationTypeMismatch when creating my model object?

    - by Maxm007
    Hi I get the following error: ActiveRecord::AssociationTypeMismatch in ContractsController#create ExchangeRate(#2183081860) expected, got HashWithIndifferentAccess(#2159586480) Params: {"commit"=>"Create", "authenticity_token"=>"g2/Vm2pTcDGk6uRas+aTgpiQiGDY8lsc3UoL8iE+7+E=", "contract"=>{"side"=>"BUY", "currency_id"=>"488525179", "amount"=>"1000", "user_id"=>"633107804", "exchange_rate"=>{"rate"=>"1.7"}}} My relevant model is : class Contract < ActiveRecord::Base belongs_to :currency belongs_to :user has_one :exchange_rate has_many :trades accepts_nested_attributes_for :exchange_rate end class ExchangeRate < ActiveRecord::Base belongs_to :denccy, :class_name=>"Currency" belongs_to :numccy, :class_name=>"Currency" belongs_to :contract end My view is: <% form_for @contract do |contractForm| %> Username: <%= contractForm.collection_select(:user_id, User.all, :id, :username) %> <br> B/S: <%= contractForm.select(:side,options_for_select([['BUY', 'BUY'], ['SELL', 'SELL']], 'BUY')) %> <br> Currency: <%= contractForm.collection_select(:currency_id, Currency.all, :id, :ccy) %> <br> <br> Amount: <%= contractForm.text_field :amount %> <br> <% contractForm.fields_for @contract.exchange_rate do |rateForm|%> Rate: <%= rateForm.text_field :rate %> <br> <% end %> <%= submit_tag :Create %> <% end %> My View Controller: class ContractsController < ApplicationController def new @contract = Contract.new @contract.build_exchange_rate respond_to do |format| format.html # new.html.erb format.xml { render :xml => @contract } end end def create @contract = Contract.new(params[:contract]) respond_to do |format| if @contract.save flash[:notice] = 'Contract was successfully created.' format.html { redirect_to(@contract) } format.xml { render :xml => @contract, :status => :created, :location => @contract } else format.html { render :action => "new" } format.xml { render :xml => @contract.errors, :status => :unprocessable_entity } end end end I'm not sure why it's not recognizing the exchange rate attributes? Thank you

    Read the article

  • Single Form with Multiple Dynamic Buttons

    - by John Reilly
    I've spent hours/days trying to figure this out and now I'm completely perplexed so I thought I'd give stackoverflow a try. I'm (a newb) working in Java/JSP using Eclipse hosting on Google App Engine trying to develop an app for a volunteer organization I'm a member of. Rather than embarrass myself by showing my current code I'd love just a nudge in the right direction. I have a form (which doubles as a report basically) showing "people" grouped under the "task" they are currently working on. I would like to select multiple people from multiple tasks and reassign them to another task e.g. Bill and Jane are Gardening, Jeff is Painting. I want to select Jane and Jeff (all people have an associated checkbox in the form) and re-assign them to Sweeping (which is a task on the form but has no people assigned to it yet). Ideally, the re-assignment to Sweeping would be via a Sweeping button (each task would have a dynamically-created task button) that would pass the "Sweeping" value to a servlet along with an array or list of people whose checkbox has been checked. The servlet would handle the request (creating an Assignment "object/entity" with timeStamp, personId, taskId) and then re-direct back to the form/report which would then repaint with the current tasks/people generated from the Assignments class in the datastore. All the tasks are user-defined and retrieved from the database when building the form. Ditto the people. I've been trying to keep the jsp for presentation and the servlets for the processing but I'm no purist and would just like to get unstuck. Many thanks in advance for your assistance.

    Read the article

  • How to automatically create Word documents which include list fields from a custom SharePoint list?

    - by Marius
    Hi, Is it possible to automatically create Word documents which include list fields from a custom SharePoint list? here is the scenario: - custom list (over 100 columns) - Word templates (not sure where is best to store them yet) - Entry Form will provide data for the templates (or partial data, ie Client name, Sales Rep) - a form that will have buttons (ie 'Create Order Form', 'Create PO') the idea is to be able to generate partial populated templates from a custom list with a puch of a button. All solutions are realy appreciated!!! Thanks,

    Read the article

  • Send form when hitting enter

    - by Álvaro G. Vicario
    I have a form in a jQuery enabled site. The form does not feature an <input type="submit"> button. For that reason, it's not submitted when you hit enter. What's the recommended way to emulate such behaviour? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head><title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"><!-- $(function(){ $("form input:first").focus(); }); //--></script> </head> <body> <form action="" method="post"> <input type="text" name="user"> <input type="password" name="pass"> </form> </body> </html>

    Read the article

  • How do I do event handling in php with html?

    - by TheAmazingKnight
    I am constructing a simple quiz using html and php. The problem I'm having is that I'm not sure how to do event handlers since it's my first time doing php. Simply, the user click on Take Quiz and it brings up the quiz, then submit the quiz using the same page and show score results. The quiz was written in HTML as shown below: HTML CODE: <section> <h1 id="theme"><span class="initial">Q</span>uiz</h1> <div id="message">Why not go ahead and take the quiz to test your knowledge based on what you've learned in Smartphone Photography. There are only 5 questions surrounding the content of this site. Good Luck! :) <br/> <button type="button" name="name" onclick="takeQuiz()">Take Quiz!</button> </div> </section> </div> <form action="grade.php" method="post" id="quiz"> <!--Question 1--> <h3>1. How many percent of modern camera phones use CMOS?</h3> <div> <input type="radio" name="question-1-answers" id="question-1-answers-A" value="A" /> <label for="question-1-answers-A">A) 20%</label> <br/> <input type="radio" name="question-1-answers" id="question-1-answers-B" value="B" /> <label for="question-1-answers-B">B) 80%</label> <br/> <input type="radio" name="question-1-answers" id="question-1-answers-C" value="C" /> <label for="question-1-answers-C">C) 50%</label> <br/> <input type="radio" name="question-1-answers" id="question-1-answers-D" value="D" /> <label for="question-1-answers-D">D) 90%</label> </div> <!--Question 2--> <h3>2. Which type of camera setting(s) is best for greater control and flexibility in terms of focusing on a subject?</h3> <div> <input type="radio" name="question-2-answers" id="question-2-answers-A" value="A" /> <label for="question-2-answers-A">A) Manual Focus</label> <br/> <input type="radio" name="question-2-answers" id="question-2-answers-B" value="B" /> <label for="question-2-answers-B">B) Auto Focus</label> <br/> <input type="radio" name="question-2-answers" id="question-2-answers-C" value="C" /> <label for="question-2-answers-C">C) Both A and B</label> <br/> <input type="radio" name="question-2-answers" id="question-2-answers-D" value="D" /> <label for="question-2-answers-D">D) Neither</label> </div> <!--Question 3--> <h3>3. What are the three properties included in an exposure triangle?</h3> <div> <input type="radio" name="question-3-answers" id="question-3-answers-A" value="A" /> <label for="question-3-answers-A">A) White Balance, ISO, Low Light</label> <br/> <input type="radio" name="question-3-answers" id="question-3-answers-B" value="B" /> <label for="question-3-answers-B">B) Shutter Speed, Exposure, ISO</label> <br/> <input type="radio" name="question-3-answers" id="question-3-answers-C" value="C" /> <label for="question-3-answers-C">C) Aperture, ISO, Exposure</label> <br/> <input type="radio" name="question-3-answers" id="question-3-answers-D" value="D" /> <label for="question-3-answers-D">D) ISO, Aperture, Shutter Speed</label> </div> <!--Question 4--> <h3>4. The higher the ISO, the more noise it produces in an image.</h3> <div> <input type="radio" name="question-4-answers" id="question-4-answers-A" value="A" /> <label for="question-4-answers-A">A) True</label> <br/> <input type="radio" name="question-4-answers" id="question-4-answers-B" value="B" /> <label for="question-4-answers-B">B) False</label> </div> <!--Question 5--> <h3>5. What is the name of the smartphone you've seen all over this site?</h3> <div> <input type="radio" name="question-5-answers" id="question-5-answers-A" value="A" /> <label for="question-5-answers-A">A) Nokia Pureview 808</label> <br/> <input type="radio" name="question-5-answers" id="question-5-answers-B" value="B" /> <label for="question-5-answers-B">B) Nokia Lumia 1020</label> <br/> <input type="radio" name="question-5-answers" id="question-5-answers-C" value="C" /> <label for="question-5-answers-C">C) Nokia Lumia 925</label> <br/> <input type="radio" name="question-5-answers" id="question-5-answers-D" value="D" /> <label for="question-5-answers-D">D) Nokia Lumia 920</label> </div> <input type="submit" value="Submit Quiz" /> </form> Then I have a php file named grade.php which will print the results of the quiz grade. PHP CODE: <?php // create variables linking the questions' answers from the form $answer1 = $_POST['question-1-answers']; $answer2 = $_POST['question-2-answers']; $answer3 = $_POST['question-3-answers']; $answer4 = $_POST['question-4-answers']; $answer5 = $_POST['question-5-answers']; $totalCorrect = 0; // Set up if-statements and determine the correct answers to be POSTed if($answer1 == "D") { $totalCorrect++; } if($answer2 == "A") { $totalCorrect++; } if($answer3 == "D") { $totalCorrect++; } if($answer4 == "A") { $totalCorrect++; } if($answer5 == "B") { $totalCorrect++; } //display the results echo "<div id='results'>$totalCorrect / 5 correct</div>"; ?>

    Read the article

  • Making two Windows using CreateWindowsEx() - C

    - by Jamie Keeling
    Hello, I have a windows form that has a simple menu and performs a simple operation, I want to be able to create another windows form with all the functionality of a menu bar, message pump etc.. as a separate thread so I can then share the results of the operation to the second window. I.E. 1) Form A opens Form B opens as a separate thread 2)Form A performs operation 3)Form A passes results via memory to Form B 4)Form B display results I'm confused as to how to go about it, the main app runs fine but i'm not sure how to add a second window if the first one already exists. I think that using CreateWindow will allow me to make another window but again i'm not sure how to access the message pump so I can respond to certain events like WM_CREATE on the second window. I hope it makes sense. Thanks! Edit: I've attempted to make a second window and although this does compile, no windows show atall on build. ////////////////////// // WINDOWS FUNCTION // ////////////////////// LRESULT CALLBACK WindowFunc(HWND hMainWindow, UINT message, WPARAM wParam, LPARAM lParam) { //Fields WCHAR buffer[256]; struct DiceData storage; HWND hwnd; // Act on current message switch(message) { case WM_CREATE: AddMenus(hMainWindow); hwnd = CreateWindowEx( 0, "ChildWClass", (LPCTSTR) NULL, WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 0, 0, hMainWindow, NULL, NULL, NULL); ShowWindow(hwnd, SW_SHOW); break; Any suggestions as to why this happens?

    Read the article

  • How to deal with array of checkbox values in Ruby 1.9.1?

    - by Ola Tuvesson
    In Ruby 1.9.1 strings are no longer enumerable and string.each is undefined. This causes a problem when parsing values for an array of generated checkboxes since the field value, when submitted, becomes an array of strings. For example: <% for map in Map.find(:all) %> <%= check_box_tag "listing[map_ids][]", map.id %> <%= map.title %> <% end %> This will result in an error, undefined method `each' for "1":String, in process_parameter_filter because map_ids is being passed as "map_ids"=["1","2"] (if checkboxes with values 1 and 2 have been checked that is). What is the recommended way to fix this?

    Read the article

  • Python Mechanize select a form with no name

    - by mvid
    I am attempting to have mechanize select a form from a page, but the form in question has no "name" attribute in the html. What should I do? when I try to use br.select_form(name = "") i get errors that no form is declared with that name, and the function requires a name input. There is only one form on the page, is there some other way I can select that form?

    Read the article

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