473,387 Members | 1,455 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,387 software developers and data experts.

How to programmatically update a menu following changes to another menu

Greetings,

I have an Dreamweaver CS3 ASP page (profile.asp) in which project management users can update project information presented in a Record Update Form. I have three menu form fields ("FY", "Qtr" and "Mth") included in a fieldset form element that contain the values for a project's deadline: fiscal year, quarter and month, respectively.

My goal is to build functionality into the page such that when a user changes a value for any of the three aforementioned date menu fields, an automatic change will occur to the value of a fourth menu field in the fieldset (named "Status"), changing its value to a pre-determined setting (in this case, the word "Yellow"). I would also like to then lock the "Status" menu field so that a user can't return the field value to its original setting.

I know how to code this in VisualBasic for a MS Access form, but am not sure how to accomplish the same in ASP.

I can provide detailed code for anyone who needs it. Whatever help anybody can offer would be most appreciated.

Regards,

- JM
Apr 18 '08 #1
8 1492
jhardman
3,406 Expert 2GB
Go ahead and post your code, that might help. I think the issue, though, is that you need client-side coding to get this to work, and ASP is strictly server-side (it only runs while the page is loading, after that ASP code is dead). So a better question would be to ask "how do I do this with javascript". Let me know if this helps.

Jared
Apr 21 '08 #2
jeffstl
432 Expert 256MB
Greetings,

I have an Dreamweaver CS3 ASP page (profile.asp) in which project management users can update project information presented in a Record Update Form. I have three menu form fields ("FY", "Qtr" and "Mth") included in a fieldset form element that contain the values for a project's deadline: fiscal year, quarter and month, respectively.

My goal is to build functionality into the page such that when a user changes a value for any of the three aforementioned date menu fields, an automatic change will occur to the value of a fourth menu field in the fieldset (named "Status"), changing its value to a pre-determined setting (in this case, the word "Yellow"). I would also like to then lock the "Status" menu field so that a user can't return the field value to its original setting.

I know how to code this in VisualBasic for a MS Access form, but am not sure how to accomplish the same in ASP.

I can provide detailed code for anyone who needs it. Whatever help anybody can offer would be most appreciated.

Regards,

- JM
Again same question, is this asp.net or classic asp?

if it is asp.net then you can use the onChange event of the controls you refer to, that will trigger your code to populate your second control.

If classic asp then you will need to either refresh your page each time and send the parameters through a querystring, or you will have to use client side scripting such as javascript
Apr 21 '08 #3
Greetings,

I started this post several months ago and want to revisit it now as I'm ready to troubleshoot this issue.

I want to use Javascript to make this work. While I'm far from a Javascript expert, I took a stab at writing the code, which I've posted below.

Expand|Select|Wrap|Line Numbers
  1. <SCRIPT language=JavaScript>
  2. function datechange()
  3. {
  4. (document.form1.Status.options[document.form1.Status.selectedIndex].text == "YELLOW");
  5. alert('ALERT: Any change to the Projected Launch Date will result in the TEMPORARY changing of your Status Flag to YELLOW.')
  6. }
  7. </script>
To summarize what's supposed to happen, this function is called in an onchange event to any of three different list/menus in the form. When the user changes the value in these list/menus (not shown above), I want two things to happen:

(1) A pop-up alert is activated.
(2) An automatic change is made to another list/menu in the form (Status) in which the value of this list/menu changes to the word "YELLOW", which is one of three standard values in the list (GREEN, YELLOW, RED).

As it stands now, I can get (1) to work but not (2). Any help that can be offered would be greatly appreciated.

Regards,

JM
Sep 23 '08 #4
jhardman
3,406 Expert 2GB
so (to confirm) all you want to do is change which option is selected in the second drop-down? I'm not a javascript expert either, I would have to think about it in detail in order to make it work, but if you answer this question I will attempt it.

(BTW, I moved the thread to the javascript forum so hopefully some javascript experts can weigh in)

Jared
Sep 24 '08 #5
That's correct. All I want the function to do is change which option is selected in the second list/menu.

JM

P.S. Thanks for moving the thread. I didn't realize it wasn't in the Javascript forum.
Sep 24 '08 #6
acoder
16,027 Expert Mod 8TB
Is the drop down element that needs to be changed named "Status"? If so, it's simply:
Expand|Select|Wrap|Line Numbers
  1. document.form1.Status.value = "YELLOW";
providing you've set the option values.
Sep 24 '08 #7
That works. Thanks!

JM
Sep 24 '08 #8
acoder
16,027 Expert Mod 8TB
Glad it does and you're welcome.
Sep 24 '08 #9

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

Similar topics

3
by: Angelos | last post by:
Hello there, I am trying to write a script that will create dynamically a menu from MySQL database. The database table is a product categories table and it has the folowing filed: category_id,...
9
by: Dom Boyce | last post by:
Hi First up, I am using MS Access 2002. I have a database which records analyst rating changes for a list of companies on a daily basis. Unfortunately, the database has been set up (by my...
1
by: Just_Buy | last post by:
Environment: MS Access 97 Problem: Trying to force a record to update using the recordset.Update property. What syntax do I need to force a record to be updated? I have searched the...
11
by: Zlatko Matić | last post by:
Hello. I have a MS Access front-end working with PostgreSQL database. I have successfully created saved File DSN. My paa-through queries are referring to that file as well as linked tables. But I...
1
by: Mike | last post by:
I am trying to programmatically change the text of a menu item in a submenu of context menu. The menu item starts off as "Play" and I later execute this.menuItem1.Text = "Stop"; I can confirm...
5
by: Neo Geshel | last post by:
Greetings. I am in a very big pickle. I am trying to add page content - as well as a submit button - programatically to a web form that is supposed to submit to DB and then refresh. That...
3
by: dhaneshrs | last post by:
I have a gridview i managed to update using the edit option in the smartmenu. The problem comes when i delete a value or make a value read only. Say i have a table Employee with the following...
2
by: BobLewiston | last post by:
Some of you may have seen my earlier thread “PasswordHash NULL problem”. I’ve started a new thread because investigation has shown that the problem is actually quite different than I previously...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.