Web Analytics Made Easy -
StatCounter How can I use an onchange event for a hidden field - CodingForum

Announcement

Collapse
No announcement yet.

How can I use an onchange event for a hidden field

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can I use an onchange event for a hidden field

    Can somebody help me with this...
    I have a hidden field and when the contents of this field changes I would like the user to confirm. The contents of the field is the date which is populated by the function popupcalendar. The completedate.Datefield<%=i%> is hidden and i cannot use the onchange method..is there any other way to get the desired result.

    here is the code...

    if (!document.layers) {

    document.write(" <input type=hidden name='ivalue' value=<%=i%>><img SRC='images/chgstatus.gif' onclick=popUpCalendar(this, completedate.Datefield<%=i%>, \"mm/dd/yyyy\",null,0,15,50);'> ")
    document.write(" <input type=hidden name='Datefield<%=i%>' size=11 Value=<%=Date()%> onchange='confirming();'> </td>");
    }


    function confirming()
    {
    var dfield=completedate.Datefield<%=i%>.value;
    var x=confirm('Date completed on is '+ dfield +'. Click OK to accept or Cancel to reject');

    if (x)
    document.completedate.submit();
    else
    alert('Please click on [chg Status] to enter new \"completed on\" date');
    }
    Last edited by suj; Feb 19, 2004, 07:33 PM.

  • #2
    Why not add the confirmation to the code that calls the popup calendar?
    Check out the Forum Search. It's the short path to getting great results from this forum.

    Comment


    • #3
      Thanks...but many others are calling the same function

      Thanks...I did think of it but many others are calling the same function.

      Thanks all the same

      Comment


      • #4
        Then write a function that calls that function and then confirms the date with the user. You can call that function anywhere you need to confirm a date after it's entered.
        Check out the Forum Search. It's the short path to getting great results from this forum.

        Comment

        Working...
        X