Search Results

Search found 20513 results on 821 pages for 'form submit'.

Page 13/821 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • jQuery validation with submit handler

    - by James
    I setup the form validation using jQuery validation plug-in's validate method and I have a submit handler that modifies the input element's value (I use YUI editor and it needs saveHTML() call to copy the iframe's content to the textarea element.). When submitting the form, I want the validator to validate the form after executing my submit handler. But it doesn't execute my submit handler if it is registered after the validate call. For example, <form id="form1" action="/test"> <input type="text" name="txt1" id="txt1" /> <input type="submit" value="submit" /> $(document).ready(function() { $("#form1").submit(function() { $("#txt1").val("123456"); }); $("#form1").validate({ rules: { txt1: { maxlength: 5 } } }); }); The form is validated after my submit handler so submit is canceled. $(document).ready(function() { $("#form1").validate({ rules: { txt1: { maxlength: 5 } } }); $("#form1").submit(function() { $("#txt1").val("123456"); }); }); However if I change the order the form is validated before my submit handler.

    Read the article

  • How to create javascript object from form elements using jQuery

    - by ob
    I'd like to be able to create a javascript object from my html form and am wondering if there's a good way to do this using jquery. I guess what i'm looking for is something similar to $.serialize, but which would result in a map instead of a string. <form> <input type="text" name="foo1" value="bar1" /> <input type="text" name="foo2" value="bar2" /> </form> desired result: { foo1:"bar1", foo2:"bar2" }

    Read the article

  • How do I layout a form in WPF using grid or other controls for maintainability

    - by Jason Coyne
    I have a WPF form, I want to lay out a standard form onto it. Each form element will have a label, and then a control. Pretty standard stuff. If I use a wrap panel, it can cause the label and the control to be separated, but I want them to stay together. is there some WPF equivalent of nobr? Grid works, and allows for column spanning etc, however I really really hate that you specify the column and row on each control. This makes it extremely inconvenient to reorder or insert things into the list. Is there a way to get the grid to use more HTML style column/rows where the items are a child of the row they are in, so that I can re-order easily? Is there some other control that will let me layout a form easily?

    Read the article

  • Web Form Security

    - by brandon14_99
    I set a cookie in the headers with an md5 hashed keyword. Then in my code, it checks for the exact matching cookie before displaying a form. Is this pretty much pointless? The form submits to an external site, so I am trying to secure the form without using captcha..

    Read the article

  • Safari and Chrome back button changes hidden and submit values in forms

    - by OverClocked
    The following problem happens on both Safari and Chrome, so probably a WebKit issue. Page A: a page that requires you to login to see, contains a form that has a type=submit button, with name=submit, and value=a Page B: some other page Page C: ask user to login page, contains a form with a type=submit button, with name=submit and value=c User visits page A, then page B. Then idles and the user's login session times out. User hits back button to go back to page A. Browser redirects user to page C. On Safari and Chrome, when C is rendered, the form on page C has the type=submit button, name=submit, but value shows up as "a". If you reload while on page C, "c" appears as the value of the name=submit button. The same problem appears with type=hidden input fields; when user hits back button, their values are also changed to some other value from some other form. Also, this problem also shows up w/o the redirect, with just submit then back. In this case the previous page renders with incorrect values for hidden and submit CGI variables. So far the only fix I can come up with is use Javascript to reset the type=hidden and type=submit variable values, after page C loads, to make sure the values are correct. But that's not clean and universally applicable. Short of WebKit fixing this error, has anyone ran into a better workaround? Thanks.

    Read the article

  • Form Submits to white page?

    - by Seth
    So I have a form for my register system. When the form submits and there's errors, (like 'Enter a username first!' or 'You must provide a password!') it successfully refreshes the page and shows those errors. HOWEVER, when the form submits and the user has filled out all of the data, and there is NO errors, the form goes to a white page. I looked in the source, and all that shows is the javascript at the top of my page, but it looks like no PHP/HTML is being executed. What is happening?!

    Read the article

  • hook up resource manager in windows form

    - by peterchen0303
    In Visual Studio 2008, develop legacy windows form (not wpf), I wrote customized resource manager which fetched data from sql server rather than assembly. In windows form, there is property related to language setting. Once I change language, I want to form being updated automatically. Is there any elegant way to hook up my resource manager?

    Read the article

  • Resize form objects in Java

    - by PeerFull
    I have a Java applet, which is a form that draw shapes into it (Rect, Oval, Line). Each shape is represented by 2 points and can draw itself to the form. When the JApplet form resizes, I need to resize the shapes also while keeping the aspect ratio. I didn't find an high quality solution for doing this that solves this problem. Tried to write a solution from this, but it came up as lousy when tested, Can someone publish an example code for doing that please?

    Read the article

  • Differing form size between XP and 7

    - by Andy
    I am developing a C# WinForms app on my XP dev machine with Visual C# Express 2008. I set the form to have a size of my liking with Width and Height on the designer and all looks good. I also set these dimensions to the MaximumSize property. Deploying the app to another XP machine, and the app looks like it does on my dev. However, in testing the app on a Win7 machine, the form has both horizontal and vertical scrollbars applied. I assume that this is due to the changed non-client size of the form, as determined by Win7. I can resize the window, but I would like it to be displayed correctly to begin with. So, my question is: What is the best way to correctly maintain a form size client area across OS'es? Thanks all.

    Read the article

  • XML configuration of Zend_Form: child nodes and attributes not always equal?

    - by Cez
    A set of forms (using Zend_Form) that I have been working on were causing me some headaches trying to figure out what was wrong with my XML configuration, as I kept getting unexpected HTML output for a particular INPUT element. It was supposed to be getting a default value, but nothing appeared. It appears that the following 2 pieces of XML are not equal when used to instantiate Zend_Form: Snippet #1: <form> <elements> <test type="hidden"> <options ignore="true" value="foo"/> </test> </elements> </form> Snippet #2: <form> <elements> <test type="hidden"> <options ignore="true"> <value>foo</value> </options> </test> </elements> </form> The type of the element doesn't appear to make a difference, so it doesn't appear to be related to hidden fields. Is this expected or not?

    Read the article

  • php $_POST array empty upon form submission...

    - by Mike D
    Hi folks, I'm baffled on this after much googling. This issue is simple, I have a custom CMS i've built that works perfectly on my dev box (Ubuntu/PHP5+/MySQL5+). I just moved it up to the production box for my client and now all form submissions are showing up as empty $_POST arrays. I found a trick to verify the data is actually being passed using "file_get_contents('php://input');" and the data is showing up fine there -- the $_POST/$_REQUEST arrays are always empty. I've also verified the content-type headers are correct as well via firebug (application/x-www-form-urlencoded; charset=utf-8). This issue is happening regardless of whether a form is submitting via AJAX or a regular form submit. Any help is greatly appreciated!

    Read the article

  • how do I hide certain part of form

    - by yogsma
    I have a form and it contains dropdown box and different div items. Based on selection from dropdown box, I show those div items. But some of the text in those div items are shown when the form is loaded and not when I select the option from dropdown box. The code is somewhat like this <form> <select id=""> <option value="one"> One </option> <option value="two"> Two </option> <option value="three"> Three </option> </select> <div id="onee"> header text ..<table> </table></div> <div id="twoo"> header text ..<table> </table></div> </form> So when I load the page form with select drop down box is shown , but it also shows header text which is within div. How do I hide that text?

    Read the article

  • Why is cakephp form input stored in $this->data and POST data stored in $this->params['form'] ?

    - by spudnik1979
    the cakephp rest tutorial says that post data should be in $this-data, but I am finding that it is not, but instead inside $this-params['form'] However, when using cakephp form helper in a view, the data is in $this-data. Am I correct to have to check both locations in my controller? It just seems a bit of a waste of extra code. Shouldnt the data appear in one place for whether it came from a rest rest requestor or Cakephp form post? ps im using cakephp 1.3

    Read the article

  • jQuery - get form elements by container id

    - by ungarida
    Which is the easiest way to get all form elements which are contained by a wrapper element. <form name="myForm"> <input name="elementA" /> <div id="wrapper"> <input name="elementB" /> <textarea name="elementC" /> </div> </form> In the above HTML I would elementB and elementC but not elementA. I do not want to list all form element types (select,textarea,input,option...). I would prefer to use myForm.elements. Any ideas?

    Read the article

  • Focusing on a form element in an iFrame

    - by Irwin
    how do I load a page in an iframe and set focus to a form element once the page loads? I don't have control over the page I am calling into the iframe, but I know the name of the form is 'form' and the text field I want to focus on is 'go'.

    Read the article

  • Create form select from object containing values

    - by marks34
    I have such an object : var options = {1: 'Running', 2: 'Falling', 3: 'Collapsing wall', 4: (...)}; I'd like to create form's select element with ooptions taken from this object, so something like that (code I tried which is not working, but you can get the idea) : html = '<form action="" ><select name="block-action"><option>-------</option>'; for(k in obj){ html += '<option value="'+k+'">'+obj[k]+'</option>' } html += '</select></form>'

    Read the article

  • drupal adding onchange event to node form

    - by Arun
    hi i need to know how to add attribute onchange to a custom content_type field? For ex my content_type has 2 fields phone (name:field_phone[0][value], id:edit-field-phone-0-value),email (name:field_email[0][value], id:edit-field-email-0-value). i'm unable to add attribute as follows. function knpevents_form_event_node_form_alter(&$form, &$form_state) { $form['title']['#attributes'] = array('onchange' => "return titlevalidate(0)");//fine $form['field_evt_org[0][value]']['#attributes']= array('onchange' => "return organiservalidate(0)"); //error $form['field_evt_org[0][value]']['#attributes']= array('onchange' => "return organiservalidate(0)"); //error } how to add it

    Read the article

  • Submitting form in php file accessed by Ajax?

    - by dronnoc
    Hi people, I am trying to figure out how to submit a form in a page being accessed by Ajax? here are some code snippets to help demonstrate what i am trying to say. HTML BODY - THIS IS WHAT THE USER WILL SEE. <html> <head> <script language="javascript" src="linktoajaxfile.js"> </head> <body onLoad="gotoPage(0)"> <div id="fillThis"> </div> </body> </html> AJAX FILE var xmlhttp function gotoPage(phase) { xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support AJAX!"); return; } var url="pageofstuffce.php"; url=url+"?stg="+phase; url=url+"&sid="+Math.random(); xmlhttp.onreadystatechange=stateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } function stateChanged() { if (xmlhttp.readyState==4) { document.getElementById("fillThis").innerHTML=xmlhttp.responseText; } } function GetXmlHttpObject() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } if (window.ActiveXObject) { // code for IE6, IE5 return new ActiveXObject("Microsoft.XMLHTTP"); } return null; } PAGE OF DATA <?php $stage = $_GET['stg']; if($stage == 0) { echo '<a onClick="gotoPage(1)">click me</a>'; } elseif($stage == 1) { <form> <input type="text" name="name"> <input type="submit" name="submit"> </form> } elseif(somehow can reach here) { show data from form. } ?> Can anyone perhaps help me get past the form and display the data in the same page? Also, i have looked around, and i don't think anything around has what i need... correct me if i'm wrong though :) Thanks in advance, and i hope i didn't put in too much detail :) Dronnoc EDIT Forgot to mention what I've tried; I have tried submitting the form to itself (same file) and that destroyed the ajax link, and opened the page. i have also tried just having the button move the page onto another step, but the $_POST variable is empty... i am at a loss, so does anyone else have any ideas?

    Read the article

  • list arrays in Drupal form

    - by bert
    Is there a better way to find all form elements in a Drupal form than doing a print_r($form)? This dumps excessive amount of information and it is no obvious what to look for.

    Read the article

  • How to find the submit button in a specific form in jQuery

    - by leifg
    I try to get jQuery object of a submit button in a specific form (there are several forms on the same page). I managed to get the form element itself. It looks something like this: var curForm = curElement.parents("form"); The current Element has the context HTMLInputElement. The several techniques I tried to get the according submit element of the form: var curSubmit = curForm.find("input[type='submit']"); var curSubmit = $(curForm).find("input[type='submit']"); var curSubmit = curForm.find(":submit"); var curSubmit = $(curForm).find(":submit"); var curSubmit = $(curSubmit, "input[type='submit']"); the result is always the same (and very strange). The result that I get is the same element as "curElement". So how can I get the right submit button?

    Read the article

  • CodeIgniter Form Validaton + JS. Form re-population.

    - by solefald
    Hello. I have a from with a checkbox, and depending on the checkbox state 2 different divs are shown. var alias = document.getElementById('alias'); var list = document.getElementById('list'); if(document.getElementById('isList').checked) { alias.style.display = 'none'; list.style.display = 'table-row'; } else { alias.style.display = 'table-row'; list.style.display = 'none'; } Here is the HTML/PHP (relevant) part: <tr id="alias" style="display:table-row;"> <td>' . form_label('Destination:', 'destination') . '</td> <td>' . form_textarea('destination') . '</td> </tr> <tr id="list" style="display:none;"> <td>' . form_label('File Path:', 'list_path') . '</td> <td>' . form_input('list_path') . '</td> </tr> alias div is shown by default on page load, list shown then i click on isList checkbox, and alias is shown again when i click on the checkbox again. This part works great and pretty straight froward. Now, I add CodeIgniter Form Validation plugin, set appropriate rules and set-up validation plugin to re-populate the form with. Without checkbox enabled everything works great. On errors form is re-populated. However, when form is submitted with checkbox enabled, I have an issue. CI's Form Validation plugin re-populates the form, and re-enables the checkbox, but the list div that is supposed to be shown when checkbox enabled is not there, and instead the alias div is shown. Is there any way around this issue? Can i have the list div shown on list validation error? Also, i would like to avoid using JavaScript form validation, and stick with my good old PHP. Thank you in advance. -i

    Read the article

  • jQuery form check - iframe content check empty

    - by Henry
    Please check out the comment field at the bottom on http://tinyurl.com/3xow97t in Firefox - it works pretty well - the red warning gets added if empty and the submit gets disabled - once there is text inside, the submit gets re-enabled. the problem i have now, it does not work in IE. i really hope somebody can help. the iframe contents checks are inside: modules/editor/scripts/global.js

    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

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >