Jump to content

techie

Members
  • Posts

    6
  • Joined

  • Last visited

About techie

  • Birthday 04/03/1956

Previous Fields

  • Languages
    English, Hindi

Profile Information

  • Interests
    programming in ASP.NET using c#. UI designing. Functional Documentation

techie's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. I would like to delete this post as I have decided not to pursue this any longer. I would be implementing a totally different feature.
  2. Thank you so much for your guidance. I spent 3 hours this morning and took the JavaScript tutorials which I found very useful. I found the below code in Page_Load method. It seems that the scripts is being run and it works when you create and save the query: lstAllFields0.Attributes["onChange"] = "javascript:showCal(" + lstAllFields0.ClientID + ",0); return false;"; lstAllFields1.Attributes["onChange"] = "javascript:showCal(" + lstAllFields1.ClientID + ",1); return false;"; lstAllFields2.Attributes["onChange"] = "javascript:showCal(" + lstAllFields2.ClientID + ",2); return false;"; lstAllFields3.Attributes["onChange"] = "javascript:showCal(" + lstAllFields3.ClientID + ",3); return false;"; lstAllFields4.Attributes["onChange"] = "javascript:showCal(" + lstAllFields4.ClientID + ",4); return false;"; One of my coworker also told me that the lines below I have added to the FillReportCriteriaValues method is registering the script but not running it because of some .NET issue. He suggested me to Google the problems to see how to run the script during that event of populating the data into the fields: string.script = "javascript:showCal ("+ddl.ClientID+ "," + index + "); return false;";this.ClientScript.RegisterStartupScript (UpdatePanel1.GetType(), "showCal" + index.ToString(), script); I will also try console.log method to see what the 'showCal' function is doing. I will update later. Thanks
  3. I reviewed the code very closely. I found that the logic in 'showCal' is used to display the datepicker when a date field is selected while building a query. So, it makes sense to use the same function to display the datepicker when date field is populated from the saved query. However, I am at loss to figure out how to modify 'showCal' function to do that and how to call it when query data is being populated. I would appreciate further help to achieve this.
  4. Strangely, I am not seeing calShow function being called any where else in the code. So I am not sure if it is adding the datepicker. Since I am a new developer, it is a bit challenging for me to find out what this function is doing. Before the original developer left he said that he had fixed this issue by adding a new javascript function 'calShow2' and added a couple of lines of code to the 'FillReportCriteriaValues' method to call it there. He wasn't able to implement it. So now I am thinking that I need to do exactly the same. I need a javascript function which will use the 'showCal' function logic to determine if the text box field value is a date, if yes, then display the calendar icon ID img#dp0, img#dp1, img#dpl2, img#dp3 and img#dp4 in front of text boxes (#txtValue0, #txtValue1,#txtValue2,#txtValue3,#txtValue4). I am not sure how those are linked to the datepicker! I can check if needed. The line 741 in showCal function that clears the date value may be required as users might change the field selection and enter new values. Isn't adding a new javascript function as described above the easiest solution? I may be wrong. Thanks
  5. Thank you so much for your response. I tried commenting the line. It is not clearing the value but it is not displaying the datepicker either! May be I am not calling the js function during my c# event method correctly: These are the two lines I have added to 'FillReportCriteriaValues' method on the .aspx.cs page: string.script = "javascript:showCal ("+ddl.ClientID+ "," + index + "); return false;";this.ClientScript.RegisterStartupScript (UpdatePanel1.GetType(), "showCal" + index.ToString(), script); When I change the field selection in the drop-down field showing date field to something else and back to 'date' field the datepicker shows up on the page next to the text box. I would like it to show when the query fields are populated. Any further help would be appreciated. Thanks
  6. Trying to make the original post concise. A javascript function named ‘calShow’ below needs to be modified. The application that uses it allows users to create an adHoc report query by selecting data fields. When a new query is created using this application, the above function displays the calendaricon in front of the text boxes (4 of them) if date fields are selected. Otherwise, the calendar icon (datepicker) is hidden. The issue is that when a saved query is retrieved, the date value is pulled into the text box but the calendar icon is not display (datepicker is unavailable to change date). There is a c# method 'FillSavedReportQueryFields’' which calls ‘calShow' function (see 'calShow' code below). This function does display the datepicker, but it also erases the date value from the text boxes. I am okay with modifying 'calShowl' function to work correctly but I am also open to adding another javascript function, which will simply display the datepicker if the value is date (defined as "D"). I would appreciate any help with this
×
×
  • Create New...