473,321 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

How to get onchange to update immediately?

KeredDrahcir
426 256MB
I have a form that specifies the width and height of an image. I also have an option that says 'Maintain Aspect Ratio'.
If they click on that then the height and width boxes operate an onchange event so that when one is changed, it changes the other to keep the aspect ratio. Is there a way to update the other value if the user changes on then clicks submit since you have to click outside the box for the onchange to work.
Nov 17 '10 #1

✓ answered by JKing

What about using the onkeyup event? This way it updates after each number entered into the textbox.

5 2378
gits
5,390 Expert Mod 4TB
is it a checkbox? you might try to use the onclick-event instead.
Nov 17 '10 #2
KeredDrahcir
426 256MB
I'm using a tickbox. However the tickbox has the option to Maintain Aspect Ratio. I'm able to check whether it's ticked. The width and height values are input boxes, so that if one is changed, the other needs to change.

I could do this that when they click on Save it looks at the Maintain Aspect Ratio box and if it is ticked then it makes sure the Aspect Ratio is correct and if it isn't it sorts it out. I'd rather not do it that way becuase you need to know which was the last value to be changed and as far as I can see, the only way to do that is with an onchange again which brings me back to the original problem.
Nov 18 '10 #3
JKing
1,206 Expert 1GB
What about using the onkeyup event? This way it updates after each number entered into the textbox.
Nov 18 '10 #4
KeredDrahcir
426 256MB
That's brilliant. Just what I need (if it works). I'll let you know. I'll give it a try first thing tomorrow.
Nov 18 '10 #5
KeredDrahcir
426 256MB
Works like a charm. Many thanks!
Nov 19 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Lee Mundie | last post by:
Hi there, Simple problem here but can't seem to fix it! Okay, I have a select list from which people choose avatars... the list is option values ie. <option>Worm</option> ...
2
by: Mr. Smith | last post by:
Hi. I have a form with three <textarea> and one <input> element. When either of these are changed I want an "Update" button to be visible at the bottom of the form. I've tried this: On every...
2
by: Quinn | last post by:
HI! Have two from text fields named "odds" and "stake" where I enter numeric values. I want to have a text label named "returns" that is automatically updated whenever any of these changes. ...
1
by: Red Hammer | last post by:
Hi, I have a report that I used the data designer to create and what happens is that it does not update until the application is closed and opened again. For example, you can enter a new record and...
1
by: Jason Huang | last post by:
Hi, I've modified some C# .aspx file, but in the IE6 browser, that .aspx shows up just as before it was changed. How do I fix this problem. Thanks for help. Jason
4
by: pike | last post by:
DB2 UDB 8.1 FP7 We are getting intermittent deadlocks (911 RC 2) even when U row-lock has been secured. The transaction is as follows: 1) Select current application number value from table....
1
by: Stewart | last post by:
Dear All, I discovered last night that IE6 doesn't support the onchange event on the form object. I had written some script in Firefox, and tested in IE, and spent a long time trying to debug...
6
by: Daz | last post by:
Hi everyone. Firstly, I apologise if this i not what you would call a PHP problem. I get quite confused as to what lives in which realm, so if this shouldn't be posted here, please suggest where...
7
by: TriAdmin | last post by:
I am working with a system that allow me to add custom fields but I can not add OnChange() language to the custom fields. So I want to have a function in the header that recognizes when fieldx is...
6
semanticnotion
by: semanticnotion | last post by:
Hi sir i want to transform the data of one table into another through foreign key but the following error come to my browser Here is my code and data base structure. CREATE TABLE IF NOT...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.