forms

How to populate datagrid with list values as separate columns in c#

家住魔仙堡 提交于 2020-01-06 13:53:21
问题 I already have an SQlite database setup. Right now I'm parsing through it. For example, if certain values in the column Seq are >30 I transfer those values to a list. I want to use that list, to populate a datagrid view so the user can see what values were > 30 How do I populate a data grid view with multiple lists? Basically column 1 should be list1, column 2, list 2, etc. EDIT: DOES anyone think I should use a list view instead? If so, how? Here's my code for parsing to obtain values for my

Barcode scanner and input fields, replace new line call to tab call?

只愿长相守 提交于 2020-01-06 13:45:06
问题 So barcode scanners end each scan with a carriage return, which messes up forms by submitting them. Is it possible to change this so that it calls a tab instead (thus moving to the next input field)? I did a find a solution here that does that, but it manually focused on each input using their id's. The number of inputs I have is variable so I cannot do that. 回答1: Yes, it is possible. There are 2 ways: reprogram the barcode reader to send the TAB key instead of a carriage return after reading

drupal 7 form validate add class?

狂风中的少年 提交于 2020-01-06 13:26:24
问题 In my form I create a checkbox $form['existing_customer'] = array( '#type' => 'checkbox', '#title' => t('Are you an existing customer?') ); When I validate it using hook_validate I would like to add a class to the label? Any ideas how to achieve this? 回答1: I can't imagine why you'd want to do this in a validation function, and I think there's a far easier way to accomplish what you're trying to do. Each element in a Drupal form is wrapped with a container (which has an ID). Inside this

drupal 7 form validate add class?

孤街浪徒 提交于 2020-01-06 13:26:13
问题 In my form I create a checkbox $form['existing_customer'] = array( '#type' => 'checkbox', '#title' => t('Are you an existing customer?') ); When I validate it using hook_validate I would like to add a class to the label? Any ideas how to achieve this? 回答1: I can't imagine why you'd want to do this in a validation function, and I think there's a far easier way to accomplish what you're trying to do. Each element in a Drupal form is wrapped with a container (which has an ID). Inside this

MYSQL Syntax error - Codeigniter function to calculate cost

半腔热情 提交于 2020-01-06 12:55:28
问题 function stationcost($station1,$station2) { $data = array(); $this->db->select('Zone')->from('station_zone')->where('Station', $station1); $Q = $this->db->get(); $this->db->select('cost')->from('zone_cost')->where('zone', $Q); $query = $this->db->get(); if ($query->num_rows() > 0) { foreach ($query->result() as $row) { $data = $row->Cost; return $data; } } } If i change $Q to an integer, the function works correctly. I'm yet to add another station to minus the difference to calculate the zone

Submit form using jquery

一世执手 提交于 2020-01-06 12:49:20
问题 I'm trying to submit a form using JQuery. My problem comes from the fact that the front end (html+js/jquery) and the back-end is not on the same site, but it does support JSONP. The form contains a file input field, so I would be submitting Multi-part form data. How would you resolve this? 回答1: your form action would point to the site controlling the post. <form id="theForm" action="http://someurltoaformsubmitfunction" method="post"> then you can call $('#theForm').submit(); 回答2: If all you

User input verification upon certain condition

谁都会走 提交于 2020-01-06 12:48:06
问题 I am lettings users enter their Social Security number (SSN). My system checks for SSNs in use. If the SSN is in use it says that the SSN is in use and check info. However, they are not required to enter it. How do i write a script that will check if they entered it and then verify it and if they don't enter it and they NOne or n/a then let the form process. Update on question: I have a certain field value that the php checks for in the DB. If the value exists, it will not let a form process

Validate Form preventing form submission

大兔子大兔子 提交于 2020-01-06 12:47:42
问题 I am using asp.net MVC 5 and trying to validate form on submission. everything works fine until i added the below line of code to validate form using ajax call. $('#signupform').validate({ submitHandler: function (form) { $.ajax({ type: 'POST', data: JSON.stringify({ type: "WhatsNew", code: $('#PrimaryCode').val() }), url: '@Url.Action("CheckCode", "Home")', dataType: 'json', contentType: 'application/json' }) .done(function (response) { if (response == 'success') { alert('success'); } else {

redirect to php page if fields are empty

瘦欲@ 提交于 2020-01-06 12:41:00
问题 I want to redirect to the page which has a form when user submit the form without any parameters, also I want to return an error message, how can I redirect from controller to the form? <form action="controllers/Customer.controller.php" method="post"> <label for="cellPhoneNo">cell phone number</label> <input type="text" name="cellPhoneNo" class="textField"/> <label for="telephone">telephone number</label> <input type="text" name="telephone" class="textField"/> <input type="submit" name=

MySQL database populated dropdown box and PHP search

怎甘沉沦 提交于 2020-01-06 12:30:10
问题 I have question regarding search on webpage with textbox and dropdown box. I have table with fields: ID First name Last name Company name Occupation Description Now i need to make search form which will be populated from database (field Occupation ) and textbox where I can put whatever I want, and then get results from database based on those on web page. I am really sorry but i am totally begginer and only need some examples of such kind of code and much help :) Thank you 回答1: You're going