forms

JavaScript code returns false, but still the form is submittted

馋奶兔 提交于 2021-02-06 20:32:05
问题 I have a form with JavaScript validation. Upon there being an error, the submit button should 'grey-out' and the form should not be submitted. However, the last couple of functions seem to submit the form even though they pop the alert box. Why? Button code: <input type="submit" name="button" id="button" onclick='return formvalidation();' value="Next" /> Non-working function example: function BlankSite() { var SiteNum= document.getElementsByName("sitesinput")[0].value; if ((SiteNum == "") ||

Webkit Mutation Observer callback not triggered when select box attribute's change

守給你的承諾、 提交于 2021-02-06 15:25:40
问题 I am trying to monitor changes to select box (or nested option elements) with new Mutation Observer functionality. However, only "setAttribute" is triggering mutation observer's callback for me. Here's the code I am using: ~function(doc, $) { var select = $('select'); // http://www.w3.org/TR/dom/#mutation-observers var observer = new WebKitMutationObserver(function(mutations) { alert(mutations.length + " mutations happened"); }); observer.observe(select, { // monitor descendant elements –

Webkit Mutation Observer callback not triggered when select box attribute's change

痴心易碎 提交于 2021-02-06 15:24:20
问题 I am trying to monitor changes to select box (or nested option elements) with new Mutation Observer functionality. However, only "setAttribute" is triggering mutation observer's callback for me. Here's the code I am using: ~function(doc, $) { var select = $('select'); // http://www.w3.org/TR/dom/#mutation-observers var observer = new WebKitMutationObserver(function(mutations) { alert(mutations.length + " mutations happened"); }); observer.observe(select, { // monitor descendant elements –

laravel regex validation not working

核能气质少年 提交于 2021-02-06 09:14:40
问题 I've just started using laravel and I'm working on validating a textarea in one of my forms. The textarea is for the users bio and so I only want to allow letters, numbers, spaces and the following characters: , . ? ; : ' " - () ! / @ $ This is what I have $validator = Validator::make(Input::all(), array('bio' => array('regex:[a-zA-Z0-9 ,\.\?;:\'"-\(\)!/@\$]') ) ); I've been searching and trying a lot to get it to work but I just can't figure it out. Any help would be much appreciated. Thanks

laravel regex validation not working

拈花ヽ惹草 提交于 2021-02-06 09:06:11
问题 I've just started using laravel and I'm working on validating a textarea in one of my forms. The textarea is for the users bio and so I only want to allow letters, numbers, spaces and the following characters: , . ? ; : ' " - () ! / @ $ This is what I have $validator = Validator::make(Input::all(), array('bio' => array('regex:[a-zA-Z0-9 ,\.\?;:\'"-\(\)!/@\$]') ) ); I've been searching and trying a lot to get it to work but I just can't figure it out. Any help would be much appreciated. Thanks

JQuery Ajax File Upload Fail on Large Files

北城以北 提交于 2021-02-06 06:27:20
问题 I currently have a ASP.Net MVC web application that needs to upload large files using ajax. I am currently using this jQuery plugin - http://valums.com/ajax-upload/. I have also used this plugin - http://jquery.malsup.com but get the same result. The issue that I am having for large file is that the iframe that gets generated to in order for the request to be asynchronous is not loading in time. It always seems to point to this code: var doc = iframe.contentDocument ? iframe.contentDocument :

Show/Hide different forms based on a option selected

ⅰ亾dé卋堺 提交于 2021-02-06 05:55:17
问题 I would like to know how to show/hide different forms based one form's selection. In the sample code below all three forms are automatically set to display:none. I would like to only show one of the "hidden" forms if its corresponding value is selected from the "shower" form. So if option "Form 1" is selected from the "shower" form, then show Form 1 below; if option "Form 2" is selected from the "shower" form, then show Form 2; and so on. Preferably with a fade in/out animation to it or

Show/Hide different forms based on a option selected

亡梦爱人 提交于 2021-02-06 05:52:44
问题 I would like to know how to show/hide different forms based one form's selection. In the sample code below all three forms are automatically set to display:none. I would like to only show one of the "hidden" forms if its corresponding value is selected from the "shower" form. So if option "Form 1" is selected from the "shower" form, then show Form 1 below; if option "Form 2" is selected from the "shower" form, then show Form 2; and so on. Preferably with a fade in/out animation to it or

Show/Hide different forms based on a option selected

你说的曾经没有我的故事 提交于 2021-02-06 05:50:39
问题 I would like to know how to show/hide different forms based one form's selection. In the sample code below all three forms are automatically set to display:none. I would like to only show one of the "hidden" forms if its corresponding value is selected from the "shower" form. So if option "Form 1" is selected from the "shower" form, then show Form 1 below; if option "Form 2" is selected from the "shower" form, then show Form 2; and so on. Preferably with a fade in/out animation to it or

Show/Hide different forms based on a option selected

空扰寡人 提交于 2021-02-06 05:49:15
问题 I would like to know how to show/hide different forms based one form's selection. In the sample code below all three forms are automatically set to display:none. I would like to only show one of the "hidden" forms if its corresponding value is selected from the "shower" form. So if option "Form 1" is selected from the "shower" form, then show Form 1 below; if option "Form 2" is selected from the "shower" form, then show Form 2; and so on. Preferably with a fade in/out animation to it or