Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In the backend, I am using ASP.NET MVC 1.0 with the Spark View engine. When I examine the source code after an F5 refresh in Firefox 3.5.2, the page renders correctly; however, if you look at the page visually the adjacent form field field gets populated with the value from the previous field.</p> <p>I included enough code so you can just get an idea of what I'm trying to do. Again, the rendering is fine and the final view/HTML code is fine. It's what I see on the screen that is incorrect. I am using hidden vars; but the issue occurred before using it as well.</p> <p>Note in the code below, I have 2 distinct ID fields: "date_{projectTask.ProjectTaskId}" and "finishDate_{projectTask.ProjectTaskId}, which gets renders to something like "date_1" and "finishDate_2". </p> <pre><code>&lt;table&gt; &lt;for each="ProjectTask projectTask in projectTasksByProjectPhase"&gt; &lt;input type="hidden" value="${projectTask.ProjectTaskId}" /&gt; &lt;tr&gt; &lt;td class="date"&gt; &lt;div class="box"&gt; &lt;div class="datefield"&gt; &lt;input type="text" id="date_${projectTask.ProjectTaskId}" value="${startDate}" /&gt;&lt;button type="button" id="show_${projectTask.ProjectTaskId}" title="Show Calendar"&gt;&lt;img src="~/Content/yui/assets/calbtn.gif" width="18" height="18" alt="Calendar" &gt;&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/td&gt; &lt;td&gt; &lt;div class="box"&gt; &lt;div class="datefield"&gt; &lt;input type="text" id="finishDate_${projectTask.ProjectTaskId}" value="${finishDate}" /&gt;&lt;button type="button" id="finishShow_${projectTask.ProjectTaskId}" title="Show Calendar"&gt;&lt;img src="~/Content/yui/assets/calbtn.gif" width="18" height="18" alt="Calendar" &gt;&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/for&gt; &lt;/table&gt; </code></pre> <p>FYI: ${} are used to output variables in the Spark View engine.</p> <p>I am also using the YUI 2.7 Connection to make Ajax calls to update the datebase for "change" and "enter/tab key press" events. I am able to verify that the AJAX calls are made correctly and the form field values are still valid.</p> <p>The problem occurs when I just do a F5 refresh; for some reason, the "finishDate_1" gets populated with the value from "date_1".</p> <p>This problem occurs just by clicking on "date_1" and hitting F5; so, the adjacent field just gets populated even if there are no AJAX calls.</p> <p>Here's the Javascript code I call towards the end of the body"</p> <pre><code>YAHOO.util.Event.onDOMReady( function() { var idList = YAHOO.util.Dom.getElementsBy(function (el) { return (el.type == 'hidden'); }, 'input'); len = idList.length; var startDatePickers = new Array(); var finishDatePickers = new Array(); for (var i = 0; i &lt; len; i++) { var id = idList[i].value startDatePickers[i] = new DatePicker("date_" + id, "show_" + id, "cal_" + id); startDatePickers[i].valueChanged.subscribe(updateDate, 'S'); finishDatePickers[i] = new DatePicker("finishDate_" + id, "finishShow_" + id, "finishCal_" + id); finishDatePickers[i].valueChanged.subscribe(updateDate, 'F'); } } } </code></pre> <p>The form field gets copied over before any Javascript code is processed because I call the Javascript code towards the end of the body after all HTML is rendered. So, I'm guessing it's a refresh issue in Firefox? What do you guys think?</p> <p>As you can see above, I created my own calender date picker objects which allows you to either enter the date in the text manually or by clicking on a button to view the calendar and select a date. Once you enter or select the date, an AJAX call will be made to update the datebase in the back end.</p> <p>Thanks everybody for the quick responses.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload