Selecting value in one field then causes value in another field to be selected.

I have a web form which contains a date field, the date is populated using a DatePicker which is Javascript based. The form also has a drop down box containing 3 values.

What I want to do is when a date has been selected that this will cause the dropdown list value to change to dated which is one of its 3 values. i.e. when the date field is not blank then the value will be selected in the dropdown. What I also want to happen is when the date has been selected and the dropdown value is dated then the date field and the dropdown field will be set to read only.

Anyone any ideas how to this using javascript.

Thanks,
macca

0
macca
7/12/2005 1:28:22 PM
asp.net.client-side 24353 articles. 1 followers. Follow

12 Replies
1014 Views

Similar Articles

[PageSpeed] 15

Hi Macca,
Was this helpfull?
Leon Langleyben

MCSD, ASP.NET MVP

Blog
0
llangleyben
7/12/2005 2:12:23 PM

Leon,

 

I tried to get that working but I'm not sure if I know enough about it, may be an error on my part. Do you have anymore information on this?

Can this work be done at server side even if the date is being selected at client side using a Javascript DatePicker?

macca

0
macca
7/12/2005 2:47:52 PM
What DatePicker control so you using?
Leon Langleyben

MCSD, ASP.NET MVP

Blog
0
llangleyben
7/12/2005 5:15:38 PM
0
macca
7/13/2005 8:17:50 AM
Yes, you can do it. You have even an example at link you send me:
Private Sub Calendar1_SelectionChanged(ByVal sender As Object,
ByVal e As System.EventArgs)

Handles Calendar1.SelectionChanged
...

Leon Langleyben

MCSD, ASP.NET MVP

Blog
0
llangleyben
7/13/2005 11:16:18 AM
What do you mean.
How do you do it usin the calendar1.selectionchanged??

macca
0
macca
7/13/2005 3:07:05 PM
My goodness!!!  How many different times did you post this macca?!?!  It appears to be at least 4.....
HTH, rchern.

Churned Ajax Toolkit

Please choose "Mark as Answer" for the posts that lead you to a solution.
0
rchern13
7/14/2005 3:55:25 PM
maybe if my question was answered I wouldn't feel the need to keep asking questions!!
0
macca
7/18/2005 8:24:28 AM
Hi Macca,
SelectionChanged evend handler invoked when date is selected in datepicker you are using. Add any processing you like to this event handler (set appropriate value in dropdown list, convert fields to readonly etc.)
Let me know if you still have problem with it.

Leon Langleyben

MCSD, ASP.NET MVP

Blog
0
llangleyben
7/18/2005 11:17:55 AM
Do you have some sample code for this as I'm quite new to .net.

Thanks,
macca
0
macca
7/18/2005 11:47:14 AM
macca i gave you an answer on another one of your posts...  sorry if you are ignoring that post and only using this one, i didn't know.Sad [:(]
HTH, rchern.

Churned Ajax Toolkit

Please choose "Mark as Answer" for the posts that lead you to a solution.
0
rchern13
7/18/2005 4:17:26 PM
rchern,
I used your code but it doesn't work for me at all. I think the Onblur isn't firing off the script.
macca
0
macca
7/19/2005 8:12:10 AM
Reply:

Similar Artilces:

problem with selected text field and selected value field in check box list
Hi! i have a  problem with check box list:here is the code for binding the check box list with sqldatasource  SqlDataSource1.SelectCommand = "select vcentrolno,inttpaperno from tabmarksdetails where vcbunchno='" & strBunchNo & "'"  chkEnrolNos.DataBind()say now my chkEnrolNos consist of data in this way:vcentrolno        inttpaperno selected text   selected valueA11439            1A11439            2AR439    ...

Value of one field causes selection of dropdown list
I have a date field and a dropdown list on web form. The dropdown list contains 3 values. I want that when I populate the Date field the dropdown list will be automatically set to one of the values in the drop down namely dated. Has anyone any ideas how to do this? thanks, macca Hi Macca,You can do it at server in TextChanged event of TextBox or at client in onchange event.Leon LangleybenMCSD, ASP.NET MVPBlog...

Select the value from a field of one table and place it into another table.
Using VB.NET, VS2005, SQL Server 2000. In a Windows Form, how could I provide a means for a user to select the value from a field of one table (a primary key value) and place it into another table (as a foreign key value)? The goal is to "assign" a person from one table to a location in another table by placing the person's primary key value into the location's foreign key field via an easy to use "selection" mechanism like a DataGridView or something.Thanks in advance for any help or examples.David  this is an ASP.Net forum - - you might want to check out: http://forums.microsof...

How to get value of field in one DataView into an Select statement for another DataView?
I have a DataView, called DataView1, that is showing the data from a table called INFO.  A DetailsView is attached to this DataView.When I click the Select link on a record for DataView1, I want the value of a certain field of DataView one to be put into the Select query of DataView2.  The reason being is this.DataView1 contains the data for my INFO table.DataView2 contains the data for my FILES table.INFO can have many FILES.Files can only have one INFO.  So when I click the Select link on a record on my DataView1(INFO table), I want only the files associated with t...

How Select one dropdownlist value using down arrows corresponding other dropdownlist value are select
I am using two dropdownlist box.One is used for country selection. other one is used for state selection.I am using dropdown selectedindexchanged event. when i click country dropdownlist corresponding state is selected in state dropdownlist box. How select the country in country dropdownlist using down arrow keys at the same time corresponding state is select in state dropdown list.R.Karthikeyan   kartmca: How select the country in country dropdownlist using down arrow keys at the same time corresponding state is select in state dropdown list.Generally, we don't implmenet...

Select values from one table based upon values in another...
How do I:Select f1, f2, f3, from tb1 where f1=Select f1 from tb2 where f1='condition'?Rex WinnCode-frog System Architects, Inc.VS 2005 Professional, C#, C++ Well... You might try reading up on some standard sql syntax... There are a number of different ways... Select t.f1,t.f2,t.f3 From tb1 t INNER JOIN tb2 t2 ON t.f1 = t2.f1 Where t2.f1 = 'condition'   Select t.f1,t.f2,t.f3 From tb1 t Where t.f1 IN (    Select t2.f1    From tb2 t2    where t2.f1 = 'condition')   Select t.f1,t.f2,t.f3 From tb1 t Where exists (select t2....

Dropdownlist selected value passes first value in list no matter what value is selected. why ?
 HI . I have a dropdownlist. Databinds ok but when I must pass a value as a Selected value it always passes the first value in the list even if I select another value. I tried to set the ddl to enableviewstate false but it doesn't change anything. Any ideas ? Code below, thanksLoading the ddl:       productCategories = CatalogAdmin.Admin_Product_Categories_NotIn(productId);        for (int i = 0; i < productCategories.Rows.Count; i++)        {       &...

Select value from drop down then other fields shows value in textfield depends on the dropdown.
 Hi,em new in VB.NET & develop a web based transaction which is almost 50% complete.my problem is that i have a form of Item properties, which consist on a following fields,1. Item2. Unit3. Old Price4. New Price my client wants that if user select Item from the dropdown then other fields shows value automaticlly on the textfields which is depend on the item name.for example:if user select Colgate from the dropdown then Unit, Old Price and New Price shows in textfeilds seperately.  if u have any code and tutorial about the above example then kindly share with me i will...

selection in one ddl field makes another ddl as a required field.
I have to accomplish two scenarios: 1. I have two dropdownlist fields say A and B and A has options as 'xx','aa','bb','yy','ss' A is a required field, if user selects 'xx' or 'yy' from the dropdownlist A then I need to make B as a required field.  2. There is a datefield which is not required field. I need to let user enter 'N/A' in this field if they do not have any relevant date , the way i was trying to accomplish this task is : provide a checkbox in front of this date field, if user checks it  I will fill it w...

How to select a field value from a selected row from a DataGrid in order to use it as a parameter
I am working on a web application, and I have two DataGrids.  Then end-User is supposed to select a row from one of the grids, and the event should select a key from that row in order to use it as a parameter to fill the other DataGrid.  I have been trying to do so, but I dont work the same way as I used to do it in windows applications.   I would appreciate any suggestions,   Thanks. Is there some code we can look at? I've done similar things and I've never had any problem with them. In the first grid have a select column, when it is clicked you can catch the Sel...

Using hidden field to store value then calling that value from client side
I have three tabs (1,2,3) on my main page each tab contains a datagrid... when a user select a tab then leaves the main page and returns to that main page(without exiting browser) I need for the page to open with the tab last selected by that user so that they can pick up where they left off. No one can seem to help me with this issue.... My javascript (client side) code function is as follows: <asp:HiddenField ID="hdnNewPanel" runat="server" /> <script language="javascript" type="text/javascript"> &nb...

to change value of Client Side Select html control from database value....
hello forum,  I have a select .. Demo.aspx <select id="DropAccType" name="DropAccType"> <option>Select</option> <option>Saving</option> <option >Current</option> <option>Regular</option> <option>Demat</option> </select> I want to set the value of select by fetching the data from daabase i.e. In my table if I have Value current then when i request the demo.aspx then in select Control the value Current should get selected..... Please help me to sort this out...   Thnx in advance.. Hi-I could be...

How to assign string value to dropdownlist when selected value field is an int(id of item)
 Hi i have a problem.In one of my application i am maintaining all controlvalues on a page in session using AJAX.i have done it.My page contain two dropdownlist.Data value field of items in dropdownlist is nothing but the idof items,i am retriving an selected item name from database using its id fromdatabase.once i got name the problem is that how can i give selected item of ddlistis the item name. i am triedddlist.SelectedValue=session("name")\\it gives nullddlist.SelectedItem.Text=session("name")\\\it gives object reference not set to instance of object erro...

Value to select of field
Hi,  I've got a question! In a database I have a field interest-target with values like 8,15,115,3 and 18,13,15,6 and 51,6,7,118 etc. Now I like to select from these fields the value 8. I tried the following: SELECT * FROM TABLE WHERE FIELD LIKE '%8,%' OR FIELD LIKE '%,8,%' OR FIELD LIKE '%,8%' I will the also get the value 18 wich I don't like :-( Any solutions here? Thanks!  RoelRoel Alblas, Dordrecht, Holland,www.gps2sms.nl Although it's REALLY ugly, you could try:AND FIELD NOT LIKE '%18%'AND FIELD NOT LIKE '%28...

Web resources about - Selecting value in one field then causes value in another field to be selected. - asp.net.client-side

Consultation Document on the Methods for Selecting the Chief Executive and for Forming the LegCo in 2012 ...
The " Consultation Document on the Methods for Selecting the Chief Executive and for Forming the LegCo in 2012 " was a document published on ...

Voting Machine Caught on Camera Casting Ballot for Democrat when Selecting Republican - YouTube
**UPDATE.... I've heard many reports that this is "just a calibration issue." I will say this... when I went to page 2 and began voting for city ...

Selecting The Right Jeans
Fit, style, cut, colour and wash all factor into the pursuit for great denim.

Clock ticking on selecting successor to Leigh Clifford at Qantas
With Qantas on course to chalk up its largest annual profit since 2008, the question now is whether chairman Leigh Clifford is looking to hang ...

Why are the reserves selecting the team?
Backbenchers are the reserves of the parliamentary system. They are newcomers.

Jackie French: Why selecting the right place for your plants is important
The secret of growing anything easily is to choose the best spot for what you want to grow.

Netflix turns to pirates when selecting new shows
Imagine the surprise, then, when the popular video streaming site admitted that it actually turns to torrenters for inspiration. "With the purchase ...

Boston Marathon bombing trial: Judge, lawyers face challenges in selecting jurors - CTV News
As the second phase of jury selection began in the federal death penalty trial of Boston Marathon bombing suspect Dzhokhar Tsarnaev, it immediately ...

Selecting cabinet one of first orders of business for Trudeau
One of the first orders of business for any new prime minister is picking a cabinet. Who is likely to make the cut?

Agile Analysis, Self-Selecting Teams, TDD & BDD in Methods & Tools Winter 2014 issue
... for software developers, testers and project managers – has just published its Winter 2014 issue that discusses Agile Analysis, Self-Selecting ...

Resources last updated: 12/21/2015 8:08:59 PM