forms

How to conditionally require form inputs in angular 4?

我是研究僧i 提交于 2020-08-24 05:08:19
问题 I am using template driven forms for adding the task, and there are 2 input fields of type number for estimated mins to complete task, one field is for estimated number of hrs and another is for estimated minutes to complete the task since the task estimate can be done either in hours like 1hrs , or in hours and minutes like 1Hrs 30Mins , so i want to set attribute required to inputs conditionally. So one of the 2 inputs must be set or form validation error will occur if both inputs are empty

How to Redirect only if form is not empty , JavaScript Validation

只谈情不闲聊 提交于 2020-08-20 16:03:42
问题 Right now even if input fields are empty , if submit button is pressed it shows alert"message": and then redirects to window.location="URL" What I m looking for is it only shows done alert and redirects if input fields are filled <form> <input type="text" placeholder="enter name here"> <input type="number" placeholder="enter number here"> <input type="submit" id="submitbutton" value="submit"> </form> </center> </body> <script type="text/javascript"> const submitit = document.getElementById(

Vue.js form data binding lost when browser going back to the page

一个人想着一个人 提交于 2020-08-20 08:57:26
问题 Here is what I am doing : I have a form set component that fetch data through ajax to populate the form set. The user may modify those datas from the form and submit. Problem : This work well. However, I noticed that if i navigate to another page and then hit the browser "go back one page" button, the form is there (the DOM in the template) but empty. There is no data bound in v-model input fields anymore... Most posts about this behavior are connected to vue-router, that I do not use. I

Drag PictureBox

半腔热情 提交于 2020-08-10 22:15:00
问题 I want to drag a PictureBox, and I have managed to do so. But my application doesn't do it as smoothly as Windows photo viewer. I mean the difference isn't huge or anything, but it's noticeable. Is there something I could do to make it a little less choppy? This is my simple code: int MOUSE_X = 0; int MOUSE_Y = 0; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { picBox.Image = Image.FromFile(@"D:\test_big.png"); picBox.Width = 3300; picBox.Height

Drag PictureBox

白昼怎懂夜的黑 提交于 2020-08-10 22:13:07
问题 I want to drag a PictureBox, and I have managed to do so. But my application doesn't do it as smoothly as Windows photo viewer. I mean the difference isn't huge or anything, but it's noticeable. Is there something I could do to make it a little less choppy? This is my simple code: int MOUSE_X = 0; int MOUSE_Y = 0; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { picBox.Image = Image.FromFile(@"D:\test_big.png"); picBox.Width = 3300; picBox.Height

Drag PictureBox

与世无争的帅哥 提交于 2020-08-10 22:12:13
问题 I want to drag a PictureBox, and I have managed to do so. But my application doesn't do it as smoothly as Windows photo viewer. I mean the difference isn't huge or anything, but it's noticeable. Is there something I could do to make it a little less choppy? This is my simple code: int MOUSE_X = 0; int MOUSE_Y = 0; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { picBox.Image = Image.FromFile(@"D:\test_big.png"); picBox.Width = 3300; picBox.Height

c# Selenium form automation problem sendkeys random

时光怂恿深爱的人放手 提交于 2020-08-10 19:20:07
问题 I'm trying to make a bot that can fill a form with random values from the login form in the Bidoo site. I am able to send keys with .SendKeys("keys") but I'm not able to send them randomly. I've already made a working random string generator but I'm not able to use it with the auto form filler (the "Bot" that I'm trying to make). I've tried using IWebDriver and IWebElement but when I start the "Bot" it says that it can't find the XPath (if I try to use the CSS selector or the ID or the Class

jQuery Validate - Eager validation of selectize.js and Bootstrap .btn-group-toggle inputs [duplicate]

本小妞迷上赌 提交于 2020-08-10 19:16:27
问题 This question already has answers here : jQuery Validation Plugin - 'Required' rule behaving strangely (1 answer) jQuery validate plugin: validate on blur() by default (1 answer) JQuery Validate Plugin - Eager validation on custom method when should be lazy (1 answer) Making the JQuery Validation plugin evaluation non-lazy (1 answer) onkeyup and onfocusout is not working in jQuery Validate (1 answer) Closed 25 days ago . My form contains a selectize and a Bootstrap toggle button group. Both

onChange handler doesn't fire when using custom-component

十年热恋 提交于 2020-08-10 05:41:27
问题 I'm using Formik for validation in a React app. Validation is working correctly, but my onChange handler does not fire: <Field type="text" name="name" placeholder="First Name" component={Input} onChange={() => console.log("gfdg")} /> Link to Sandbox Why is this? 回答1: Inside Input , the way you have ordered the props passed to your input element means your onChange is being overwritten by Formik's onChange . When you create a Field with a custom component (i.e. Input in your case), Formik

onChange handler doesn't fire when using custom-component

混江龙づ霸主 提交于 2020-08-10 05:39:06
问题 I'm using Formik for validation in a React app. Validation is working correctly, but my onChange handler does not fire: <Field type="text" name="name" placeholder="First Name" component={Input} onChange={() => console.log("gfdg")} /> Link to Sandbox Why is this? 回答1: Inside Input , the way you have ordered the props passed to your input element means your onChange is being overwritten by Formik's onChange . When you create a Field with a custom component (i.e. Input in your case), Formik