Search Results

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

Page 67/243 | < Previous Page | 63 64 65 66 67 68 69 70 71 72 73 74  | Next Page >

  • Add CSS to Form Type is Symfony2

    - by Umair Iqbal
    I have an edit form, The form is made through symfony2 Form types. I checked the documentation but couldn't find any option for adding CSS to the form. The form display the data correctly and everything is fine what I want to do is to add styling to each field. My Edit Type is public function buildForm(FormBuilder $builder, array $options) { $builder ->add('id', 'hidden') ->add('patent_name', 'text', array('label' => 'Patent Name')) ->add('description', 'textarea', array('label' => 'Description', 'required' => false)) ->add('appln_auth','text', array('label' => 'Application Authorization')) ; } Anyone has any idea ho I can add css ? Thanks

    Read the article

  • Arbitrary Form Processing with Drupal

    - by Aaron
    I am writing a module for my organization to cache XML feeds to static files to an arbitrary place on our webserver. I am new at Drupal development, and would like to know if I am approaching this the right way. Basically I: Expose a url via the menu hook, where a user can enter in a an output directory on the webserver and press the "dump" button and then have PHP go to drupal and get the feed xml. I don't need help with that functionality, because I actually have a prototype working in Python (outside of Drupal).. Provide a callback for the form where I can do my logic, using the form parameters. Here's the menu hook: function ncbi_cache_files_menu() { $items = array(); $items['admin/content/ncbi_cache_files'] = array( 'title' => 'NCBI Cache File Module', 'description' => 'Cache Guide static content to files', 'page callback' => 'drupal_get_form', 'page arguments' => array( 'ncbi_cache_files_show_submit'), 'access arguments' => array( 'administer site configuration' ), 'type' => MENU_NORMAL_ITEM, ); return $items; } I generate the form in: function ncbi_cache_files_show_submit() { $DEFAULT_OUT = 'http://myorg/foo'; $form[ 'ncbi_cache_files' ] = array( '#type' => 'textfield', '#title' => t('Output Directory'), '#description' => t('Where you want the static files to be dumped. This should be a directory that www has write access to, and should be accessible from the foo server'), '#default_value' => t( $DEFAULT_OUT ), '#size' => strlen( $DEFAULT_OUT ) + 5, ); $form['dump'] = array( '#type' => 'submit', '#value' => 'Dump', '#submit' => array( 'ncbi_cache_files_dump'), ); return system_settings_form( $form ); } Then the functionality is in the callback: function ncbi_cache_files_dump( $p, $q) { //dpm( get_defined_vars() ); $outdir = $p['ncbi_cache_files']['#post']['ncbi_cache_files']; drupal_set_message('outdir: ' . $outdir ); } The question: Is this a decent way of processing an arbitrary form in Drupal? I not really need to listen for any drupal hooks, because I am basically just doing some URL and file processing. What are those arguments that I'm getting in the callback ($q)? That's the form array I guess, with the post values? Is this the best way to get the form parameters to work on? Thanks for any advice.

    Read the article

  • Application loses authentication when performing redirect to a virtual directory

    - by nuhusky2003
    I have the following setup: http://www.example.com/dir1/ and http://www.example.com/dir2/ Each virtual directory is configured on IIS6.0 as an application with own AppPool. When redirecting authenticated user from dir1 to dir2 using response.redirect I lose authentication information for the user and the user is being redirected to the login page. This issue was not coming up with each app (dir1 and dir2) were configured under subdomain, ex: http://dir1.example.com and http://dir2.example.com. I have resolved the issue by adding a machine key to the machine.config file. Can someone explain to me why it's not working on a http://www.example.com/dir1 configuration?

    Read the article

  • RoR - howto convert some HTML-elements with css to Rails

    - by NicoJuicy
    I have old HTML code with html and css.. <form action="login" method="post"> <div class="field"> <label for="username">Username</label> <input type="text" class="text" id="username" name="username" value="just click login !"/> </div> <span class="fright"> <button class="button" type="submit"><strong>Log In</strong></button> </span> </div> How can i convert this code to decent rails code? I came up with this, but it ain't right :-( : <% form_for :user, @user, :url => { :action => "login" } do |f| %> <% div_for f, :class => "field text" do %> <%= f.text_field :username %> <%= f.password_field :password, :class => "field text" %> <% end %> <span class="fright"> <%= submit_tag '<strong>Inloggen</strong>', :class => "button",:disable_with => 'verwerken...' %></span> <% end %> I'm having problems with the <strong>Inloggen</strong> And with the <% div_for f, :class => "field text" do %>

    Read the article

  • jQuery selector for option tag value attribute returns null

    - by Ben
    Hello, I am trying to change the selected option in a select dropdown box with jQuery. I have it set so that it finds the hash tag at the end of the URL and based on that hash tag it changes the selected option in the select box. Most of my code is functional, it successfully finds the hash tag and executes the if statement that corresponds with it. However, when it goes to execute the "then" section of the statement when it goes to the selector for the option (which uses an attribute selector based on the value attribute of the option tag) it returns null. If figured this out with firebug, in the console it says that the selector is null. Here is my code: $(document).ready(function() { var $hash = window.location.hash if($hash == "#htmlcss") { $('option[value="HTML/CSS Coding"]').attr("selected","selected") } if($hash == "#php") { $('option[value="PHP Coding"]').attr("selected","selected") } if($hash == "#jscript") { $('option[value="Javascript and jQuery Coding"]').attr("selected","selected") } if($hash == "#improv") { $('option[value="General Website Improvements"]').attr("selected","selected") } if($hash == "#towp") { $('option[value="Website Conversion to Wordpress"]').attr("selected","selected") } if($hash == "#wptheme") { $('option[value="Wordpress Theme Design"]').attr("selected","selected") } if($hash == "#complete") { $('option[value="Complete Website Creation"]').attr("selected","selected") } if($hash == "#server") { $('option[value="Web Server Configuration"]').attr("selected","selected") } }); So to clarify, when I enter in a url that ends in the #php hash tag, for example, the desired action does not occur which would change the "PHP Coding" option to the selected one by using the "selected" html attribute however the selector for the particular option tag returns null. Is there a problem with my syntax or is my code not functioning in the way that I think it should? Thanks very much.

    Read the article

  • Validating Time & Date To Be At Least A Certain Amount Of Time In The Future

    - by MJH
    I've built a reservation form for a taxi company which works fine, but I'm having an issue with users making reservations that are due too soon in the future. Since the entire form is kind of long, I first want to make sure the user is not trying to make a reservation for less than an hour ahead of time, without them having to fill out the whole form. This is what I have come up with so far, but it's just not working: <?php //Set local time zone. date_default_timezone_set('America/New_York'); //Get current date and time. $current_time = date('Y-m-d H:i:s'); //Set reservation time variable $res_datetime = $_POST['res_datetime']; //Set event time. $event_time = strtotime($res_datetime); ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>Check Date and Time</title> </head> <?php //Check to be sure reservation time is at least one hour in the future. if (($current_time - $event_time) <= (3600)) { echo "You must make a reservation at least one hour ahead of time."; } ?> <form name="datetime" action="" method="post"> <input name="res_datetime" type="datetime-local" id="res_datetime"> <input type="submit"> </form> <body> </body> </html> How can I create a validation check to make sure the date and time of the reservation is at least one hour ahead of time?

    Read the article

  • Nested form problem in Rails : NoMethodError in Show

    - by brianheys
    I'm trying to build a simple product backlog application to teach myself Rails. For each product, there can be multiple product backlog entries, so I want to create a product view that shows the product information, all the backlog entries for the product, and includes a nested form for adding more backlog entries. Everything works until I try to add the form to the view, which then results in the following error: NoMethodError in Products#show Showing app/views/products/show.html.erb where line #29 raised: undefined method `pblog_ref' for #<Product:0x10423ba68> Extracted source (around line #29): 26: <%= f.error_messages %> 27: <p> 28: <%= f.label :pblog_ref %><br /> 29: <%= f.text_field :pblog_ref %> 30: </p> 31: <p> 32: <%= f.label :product %><br /> The product view where the problem is reported is as follows (the partial works fine, so I won't include that code): <h1>Showing product</h1> <p> <b>Product ref:</b> <%=h @product.product_ref %> </p> <p> <b>Description:</b> <%=h @product.description %> </p> <p> <b>Owner:</b> <%=h @product.owner %> </p> <p> <b>Status:</b> <%=h @product.status %> </p> <h2>Product backlog</h2> <div id="product-backlog"> <%= render :partial => @product.product_backlogs %> </div> <% form_for(@product, ProductBacklog.new) do |f| %> <%= f.error_messages %> <p> <%= f.label :pblog_ref %><br /> <%= f.text_field :pblog_ref %> </p> <p> <%= f.label :product %><br /> <%= f.text_field :product %> </p> <p> <%= f.label :description %><br /> <%= f.text_field :description %> </p> <p> <%= f.label :owner %><br /> <%= f.text_field :owner %> </p> <p> <%= f.label :status %><br /> <%= f.text_field :status %> </p> <p> <%= f.submit 'Create' %> </p> <% end %> <%= link_to 'Edit', edit_product_path(@product) %> | <%= link_to 'Back', products_path %> This is the Product model: class Product < ActiveRecord::Base validates_presence_of :product_ref, :description, :owner has_many :product_backlogs end This is the ProductBacklog model: class ProductBacklog < ActiveRecord::Base belongs_to :product end These are the routes: map.resources :product_backlogs map.resources :products, :has_many => :product_backlogs I've checked what I'm doing against the Creating a weblog in 15 minutes with Rails 2 screencast, and in principle I seem to be doing the same thing as him - only his nested comments form works, and mine doesn't! I hope someone can help with this, before I turn mad! I'm sure it's something trivial.

    Read the article

  • Keeping dates in order when using date_select and discarding year in Rails?

    - by MikeH
    My app has users who have seasonal products. When a user selects a product, we allow him to also select the product's season. We accomplish this by letting him select a start date and an end date for each product. We're using date_select to generate two sets of drop-downs: one for the start date and one for the end date. Including years doesn't make sense for our model. So we're using the option: discard_year => true To explain our problem, consider that our products are apples. Vendor X carries apples every year from September to January. Years are irrelevant here, and that's why we're using discard_year => true. However, while the specific years are irrelevant, the relative point in time from the start date to the end date is relevant. This is where our problem arises. When you use discard_year => true, Rails does set a year in the database, it just doesn't appear in the views. Rails sets all the years to 0001 in our app. Going back to our apple example, this means that the database now thinks the user has selected September 0001 to January 0001. This is a problem for us for a number of reasons. To solve this, the logic that I need to implement is the following: - If season_start month/date is before season_end month/date, then standard Rails approach is fine. - But, if season_start month/date is AFTER season_end month/date, then I need to dynamically update the database field such that the year for season_end is equal to the year for season_start + 1. My best guess is that I would create a custom method that runs as an after_save or after_update in my products model. But I'm not really sure how to do this. Ideas? Anybody ever had this issue? Thanks!

    Read the article

  • Checkbox values to varchar via Spring

    - by iowatiger08
    I am trying to get a varchar message from a database to display the selected values of a checkbox field in a jsp for patient's medication's dosage frequency. The possible values will be saved in comma-delimited string in the varchar. For most form fields there is simply a one form value to one database field ratio, but in this case, I am needing to merge the values that would come as a string[] into the comma-delimited string and then when retrieving that record for that medication of that patient, display the selected values from the comma-delimited string as selected from the selectableDosageFrequencyList. You assistance in this is greatly appreciated as I am not sure what I am missing here. In the application context, I created the list of possible values as part of the ServiceBean. <property name="selectableDosageFrequencyList"> <set> <value>On an empty stomach</value> <value>Every other day</value> <value>4 times daily</value> <value>3 times daily</value> <value>Twice daily</value> <value>At bedtime</value> <value>With meal</value> <value>As needed</value> <value>Once daily</value> </set> </property> This is set up in the flow as requestscope. <view-state id="addEditMedication" model="medication"> <on-render> <set name="requestScope.selectableDosageFrequencyList" value="memberService.buildSelectableDosageFrequencyList(patient)" /> </on-render> ... <transition on="next" to="assessment" > <evaluate expression="memberService.updateMedication(patient, medication)" /> </transition> </view-state> I have helper methods in the memberService that need to be executed when the form is init and then when the form is completed. //get the form fields selected and build the new string for db public String setSelectedDosageFrequency(String [] dosageFrequencies){ String frequencies = null; if (dosageFrequencies != null){ for (String s : dosageFrequencies){ frequencies = frequencies + "," + s; } } return frequencies; } //get value from database and build selected Set public LinkedHashSet<String> getSelectedDosageFrequencyList(String dosageFrequency){ String copyOfDosages =dosageFrequency;//may not need to do this LinkedHashSet<String> setofSelectedDosageFrequency = new LinkedHashSet<String> (); while (copyOfDosages!= null && copyOfDosages.length()>0){ for (String aFrequency: selectableDosageFrequencyList){ if (copyOfDosages.contains(aFrequency)){ setofSelectedDosageFrequency.add(aFrequency); if (!copyOfDosages.equals(aFrequency) && copyOfDosages.endsWith(aFrequency)){ copyOfDosages.replaceAll(","+aFrequency, ""); }else if (!copyOfDosages.equals(aFrequency) && copyOfDosages.contains(aFrequency=",")){ copyOfDosages.replaceAll(aFrequency+",", ""); }else copyOfDosages.replaceAll(aFrequency, ""); copyOfDosages.trim(); } } } return setofSelectedDosageFrequency; } The Medication class that backs the form will have a variable for dosage-frequency as a string. private String dosageFrequency; The jsp I currently am doing this. <div class="formField"> <form:label path="dosageFrequency">Dosage Frequency</form:label> <ul class="multi-column double" style="width: 550px;"> <form:checkboxes path="dosageFrequency" items="${selectableDosageFrequencyList}" itemLabel="${selectableDosageFrequencyList}" element="li" /> </ul> </div>

    Read the article

  • adding an uncertain number of fields using javascript

    - by user306472
    I'm new to javascript and a novice programmer, so this might be a really easy question to answer. I would like to loop over the values of x number of fields and add them up to display the sum in a final field. I can perform this function if I explicitly call each field, but I want to abstract this so I can deal with a flexible number of fields. Here's example code I've come up with (that's not working for me). Where am I going wrong? <html> <head> <script type="text/javascript"> function startAdd(){ interval = setInterval("addfields()",1); } function addfields(){ a = document.addition.total.value; b = getElementByTagName("sum").value; for (i=0; i<=b.length; i++){ a+=i; } return a; } function stopAdd(){ clearInterval(interval); } </script> </head> <body> <form name="addition"> <input type="text" name="sum" onFocus="startAdd();" onBlur="stopAdd;"> + <input type="text" name="sum" onFocus="startAdd();" onBlur="stopAdd;"> = <input type="text" name ="total"> </form> </body> </html>

    Read the article

  • PHP form processing - how to capture text from field that has variable Name/ID

    - by user80151
    I have a form that has a field pulled from the database as a dropdown. I need to get the text selected in the dropdown but I don't know in advance what the field ID will be. This is basically just a form that has already been generated. I don't need to pull anything from the database, it's already on this page. All I need to do is get the form information and email it, no writing to the database. I know how to do the _Request for the other fields based on the ID but I'm not sure how to do this one. The ID changes. It can be ID=1, ID-2, etc. I need to do something like: _REQUEST form element where ID is LIKE "ID[*]" or something similar. Any suggestions or links to tutorials? Here are a couple samples of what the dropdown renders on the page: <div class="wrapperAttribsOptions"> <h4 class="optionName back"><label class="attribsSelect" for="attrib- 1">Model</label></h4> <div class="back"> <select name="id[1]" id="attrib-1"> <option value="45">VC3-4C</option> <option value="1">VC3-4PG</option> <option value="3">VC3-4SG</option> <div class="wrapperAttribsOptions"> <h4 class="optionName back"><label class="attribsSelect" for="attrib-14">SPK Model</label></h4> <div class="back"> <select name="id[14]" id="attrib-14"> <option value="43">SPK-4</option> <option value="44">SPK-8</option> </select> TIA

    Read the article

  • Symfony2 Theming form generated by embedded controller action

    - by user1112057
    I am generating the form in embedded controller action. And now i have faced the following problem. The Form Theming is not working in that case. So what i have: The tempalte "page.html.twig" {% block content %} {% render 'MyBundle:Widget:index' %} {% endblock %} The indexAction() creates the form and rendering another template "form.html.twig" which is normally renders a form using form_row, form_rest and so on. So, now i am trying to customize form theming, and here is my problem. When i put the code {% form_theme form _self %} in the page.html.twig, i got an error the the form variable does not exists. And its correct, the form var is created later in the embedded controller. But when i put the theming code in embedded template "form.html.twig", i got another error "Variable "compound" does not exist" {% block form_label %} {% spaceless %} {% if not compound %} {% set label_attr = label_attr|merge({'for': id}) %} {% endif %} {% if required %} {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %} {% endif %} {% if label is empty %} {% set label = name|humanize %} {% endif %} <label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %} {% if attr.tooltip is defined %}title="{{ attr.tooltip }}"{% endif %}>{{ label|trans({}, translation_domain) }}{% if required %}<span>*</span>{% endif %}</label> {% endspaceless %} {% endblock form_label %} This part of code was copied from this file https://github.com/symfony/symfony/blob/2.1/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig So tried someone to do something like this?

    Read the article

  • problems selecting a mutliple select value from database in Rails

    - by Ramy
    From inside of a form_for in rails, I'm inserting multiple select values into the database, like this: <div class="new-partner-form"> <%= form_for [:admin, matching_profile.partner, matching_profile], :html => {:id => "edit_profile", :multipart => true} do |f| %> <%= f.submit "Submit", :class => "hidden" %> <div class="rounded-block quarter-wide radio-group"> <h4>Exclude customers from source:</h4> <%= f.select :source, User.select(:source).group(:source).order(:source).map {|u| [u.source,u.source]}, {:include_blank => false}, {:multiple => true} %> <%= f.error_message_on :source %> </div> I'm then trying to pull the value from the database like this: def does_not_contain_source(matching_profiles) Expression.select(matching_profiles, :source) do |keyword| Rails.logger.info("Keyword is : " + keyword) @customer_source_tokenizer ||= Tokenizer.new(User.select(:source).where("id = ?", self.owner_id).map {|u| u.source}[0]) #User.select("source").where("id = ?", self.owner_id).to_s) @customer_source_tokenizer.divergent?(keyword) end end but getting this: ExpressionErrors: Bad syntax: --- - "" - B - "" this is what the value is in the database but it seems to choke when i access it this way. What's the right way to do this?

    Read the article

  • jQuery Ajax form submit, to call php login script

    - by Stevie Jenowski
    Thanks for checking out my problem... I'm having trouble submitting a login form via Ajax for a php script to run and return a new set of html items which will be replacing the HTML in #userlinks.... heres what I have so far $("#login_form").submit(function() { return false; }); $('#login_button').click(function(event) { $form = $(this).parent("form"); $.post($form.attr("action"), $form.serialize(), function(data){ $('#userlinks').html(data); }); }); The php script checks for post data of username && password, yet all I'm getting is a page refresh and no changes. Nothing returns unless I turn login_button into a link and change the script a bit... Any help would be appreciated!

    Read the article

  • Use Apache authentication in Django without popup

    - by chernevik
    I am using Apache to authenticate users for Django, but I would like to do so without the popup form that Apache uses in its basic configuration. How do I embed the login form within a page while still using Apache for authentication? That is, I'd like a page that says "Please login" and provides a form asking for username and password, and passes this information on to Apache for authentication. (I'd do this over an SSL connection, of course.)

    Read the article

  • Codeigniter form action with slashes instead of normal GETs?

    - by Ethan
    Hey, so this is one of those questions that seems obvious, and I'm probably going to feel stupid, but here goes: I'm doing a CodeIgniter site with a search. Think of a Google type input, where you'd search for "white huskies." I have a search results page that takes a URI (MySite.com/dogs/white huskies), and takes the third part, and performs the search on that term. I'd like this to be done in the URI, and no by POST so my users can bookmark results. The problem I'm having is how to get that search button directed to Mysite.com/dogs/WHATEVER IS IN THE INPUT. How do I get the what is in the input part into the anchor href? I know I could do this with javascript, but I've heard it's bad practice to force people to have javascript for things this small. Thanks for the help!

    Read the article

  • Contact form problem - I do receive messages, but no contents (blank page).

    - by nitbuntu
    I have a contact form on site which used to work, but since last few months has stopped working properly. This could have been due to some coding error that I can't figure out. What happens is that I receive the messages sent, but they are completely blank, with no contents at all. What could be the problems? I'm attaching first the front-end page, and then the back-end. Sample of contact.php the front-end code:- <div id="content"> <h2 class="newitemsxl">Contact Us</h2> <div id="contactcontent"> <form method="post" action="contactus.php"> Name:<br /> <input type="text" name="Name" /><br /> Email:<br /> <input type="text" name="replyemail" /><br /> Your message:<br /> <textarea name="comments" cols="40" rows="4"></textarea><br /><br /> <?php require("ClassMathGuard.php"); MathGuard::insertQuestion(); ?><br /> <input type="submit" name="submit" value="Send" /> * Refresh browser for a different question. :-) </form> </div> </div> Sample of contactus.php (backend code):- <?php /* first we need to require our MathGuard class */ require ("ClassMathGuard.php"); /* this condition checks the user input. Don't change the condition, just the body within the curly braces */ if (MathGuard :: checkResult($_REQUEST['mathguard_answer'], $_REQUEST['mathguard_code'])) { $mailto="[email protected]"; $pcount=0; $gcount=0; $subject = "A Stylish Goods Enquiry"; $from="[email protected]"; echo ("Great, you're message has been sent !"); //insert your code that will be executed when user enters the correct answer } else { echo ("Sorry, wrong answer, please go back and try again !"); //insert your code which tells the user he is spamming your website } while (list($key,$val)=each($HTTP_POST_VARS)) { $pstr = $pstr."$key : $val \n "; ++$pcount; } while (list($key,$val)=each($HTTP_GET_VARS)) { $gstr = $gstr."$key : $val \n "; ++$gcount; } if ($pcount > $gcount) { $comments=$pstr; mail($mailto,$subject,$comments,"From:".$from); } else { $comments=$gstr; mail($mailto,$subject,$comments,"From:".$from); } ?>

    Read the article

  • Using CreateWindow() to make additional Window on a thread - 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!

    Read the article

  • Mysql query trouble: uploading

    - by Jakub Zak
    I'm trying for last hour solve this problem. I have a long form and I'm trying to upload info into mysql database. Into table I made. This is the mysql query I'm using: mysql_query("INSERT INTO `users_temp`(`first_name`, `surname`, `birthday`, `nationality`, `email`, `mobile`, `landline`, `address`, `town`, `post_code`, `country`, `password`, `code_conf`) VALUES ([$f_name],[$s_name],[$bday],[$nationality],[$email],[$mobile],[$landline],[$address],[$town],[$post_code],[$country],[$pass],[$conf_code])"); If anyone see any problem why it doesn't work pls let me know. Thank you...

    Read the article

  • ajaxSubmit options success & error functions aren't fired

    - by Thommy Tomka
    jQuery 1.7.2 jQuery Validate 1.1.0 jQuery Form 3.18 Wordpress 3.4.2 I am trying to code a contact/ mail form in above environment/ with above jQuery libs. Now I am having a problem with the jQuery Form JS: I have taken the original code from the developers page for ajaxSubmit and only altered the target option to an ID which exists in my HTML source and replaced $ with jQuery in function showRequest. The problem is, that the function namend after success: does not fire. I tried the same with error: and again nothing fired. Only complete: did and the function I placed there alerted the responseText from the receiving script. Does anyone has an idea whats going wrong? Thanks in advance! Thomas jQuery(document).ready(function() { var options = { target: '#mail-status', // target element(s) to be updated with server response beforeSubmit: showRequest, // pre-submit callback success: showResponse, // post-submit callback // other available options: //url: url // override for form's 'action' attribute //type: type // 'get' or 'post', override for form's 'method' attribute //dataType: null // 'xml', 'script', or 'json' (expected server response type) //clearForm: true // clear all form fields after successful submit //resetForm: true // reset the form after successful submit // $.ajax options can be used here too, for example: //timeout: 3000 }; jQuery("#mailform").validate( { submitHandler: function(form) { jQuery(form).ajaxSubmit(options); }, errorPlacement: function(error, element) { }, rules: { author: { minlength: 2, required: true }, email: { required: true, email: true }, comment: { minlength: 2, required: true } }, highlight: function(element) { jQuery(element).addClass("e"); jQuery(element.form).find("label[for=" + element.id + "]").addClass("e"); }, unhighlight: function(element) { jQuery(element).removeClass("e"); jQuery(element.form).find("label[for=" + element.id + "]").removeClass("e"); } }); }); // pre-submit callback function showRequest(formData, jqForm, options) { // formData is an array; here we use $.param to convert it to a string to display it // but the form plugin does this for you automatically when it submits the data var queryString = jQuery.param(formData); // jqForm is a jQuery object encapsulating the form element. To access the // DOM element for the form do this: // var formElement = jqForm[0]; alert('About to submit: \n\n' + queryString); // here we could return false to prevent the form from being submitted; // returning anything other than false will allow the form submit to continue return true; } // post-submit callback function showResponse(responseText, statusText, xhr, $form) { // for normal html responses, the first argument to the success callback // is the XMLHttpRequest object's responseText property // if the ajaxSubmit method was passed an Options Object with the dataType // property set to 'xml' then the first argument to the success callback // is the XMLHttpRequest object's responseXML property // if the ajaxSubmit method was passed an Options Object with the dataType // property set to 'json' then the first argument to the success callback // is the json data object returned by the server alert('status: ' + statusText + '\n\nresponseText: \n' + responseText + '\n\nThe output div should have already been updated with the responseText.'); }

    Read the article

  • Can I not submit a form to a servlet from JSF?

    - by simpatico
    * Unable to find matching navigation case with from-view-id '/home.xhtml' for action 'MemoServlet' with outcome 'MemoServlet' I try to accomplish it through: <h:commandButton type="submit" value="add" action="MemoServlet"/> but all the tutorials in the world only do it with a bean, which i don't want. I've come across any navigation rule that accomplishes my request.

    Read the article

  • What is the maximum number of controls that a VBA form can hold?

    - by Lunatik
    I'm currently building an Excel 2003 app that requires a horribly complex form and am worried about limitations on the number of controls. It currently has 154 controls (counted using Me.Controls.Count - this should be accurate, right?) but is probably only about a third complete. The workflow really fits a single form, but I guess I can split it up if I really have to. I see evidence in a Google search that VB6 (this usually includes VBA) has a hard limit of 254 controls in a form. However, I created a dummy form with well over 1200 controls which still loaded and appeared to work just fine. I did get some 'out of memory' errors when trying to add specific combinations of controls though, say 800 buttons and 150 labels, leading me to think that any limit might be affected by the memory requirements of each type of control. Does anyone have any information that might help ensure that I or, more importantly, other users with differing environments don't run into any memory issues with such a large form?

    Read the article

< Previous Page | 63 64 65 66 67 68 69 70 71 72 73 74  | Next Page >