Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 935859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:13:21+00:00 2026-05-15T21:13:21+00:00

I’m pulling my hair out over this. I have this bit of javascript that

  • 0

I’m pulling my hair out over this. I have this bit of javascript that asynchronously fetches data for an events calendar. Basically when you click on a day of the month a little UI pops up and a text area gets populated with the data that gets retrieved. On this UI are two submit buttons: one to save changes, and one to delete the event if it exists. My goal is to have the delete button disabled unless the text area gets populated with an event. Here is my code:

function editDialog(date,vis)
{
    if(vis == "show")
    {
        var event="Loading...";

        if (window.XMLHttpRequest)
        { 
            xmlhttp=new XMLHttpRequest();
        }
        else
        {
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }

        xmlhttp.onreadystatechange=function()
        {

            if (xmlhttp.readyState==4 && xmlhttp.status==200)
            {
                event = xmlhttp.responseText;
            }
            document.getElementById('editwrapper').innerHTML="<div id='editdiv'>\
            <div><span class='bold'>"+date+" </span><div style='display: inline; float: right;'><a href='#' onclick=\"return editDialog('"+date+"','hide')\">Close</a></div><hr id='line'> \
            <form method='get' action='' onsubmit=\"return editDialog(this.newdate.value, 'show')\">\
            <label for='newdate'>Jump to: </label>\
            <input type='text' name='newdate' size='10'/>\
            <input type='submit' name='go' value='Go'>\
            </form>\
            <form style='display: inline;' action='' name='saveform' method='get' onsubmit='return instantUpdate(this.date.value,this.event.value)'>\
            <textarea name='event' rows='10' cols='40' onkeypress='saveform.edit.disabled=false'>"+event+"</textarea>\
            <input type='hidden' name='date' value='"+date+"'>\
            <input type='submit' name='edit' value='Save' disabled='disabled'></form> &nbsp; <form name='deleteform' style='display: inline; float: right;' action='' method='get' onsubmit=\"return instantUpdate(saveform.date.value,'')\"> <input name='deletebutton' value='Delete' type='submit'></form>\
            </div>\
            </div>";

            if(event=="" || event=="Loading...") document.deleteform.delete.disabled = true;
        }
        xmlhttp.open("GET","events.php?action=read&date="+date,true);
        xmlhttp.send(); } }

The problem lies with this statement:

if(event=="" || event=="Loading...") document.deleteform.deletebutton.disabled = true;

Firefox handles it just fine but Safari, Chrome, Opera, and IE all throw hissy fits. They revert back to my fallback functionality for users that don’t have javascript enabled. What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:13:22+00:00Added an answer on May 15, 2026 at 9:13 pm

    I just had a thought. Since delete is a keyword you really shouldn’t be using it as a form field name. Some implementations may be more strict than others with regard to using reserved words. Try renaming it to something else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.