Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submit Stopped Working

Status
Not open for further replies.

maxhugen

Programmer
May 25, 2004
498
AU
I have a page with a List of Clients, and next to it a form with Client Details. The Clients in the list are links to the detail.

When someone changes a Client's Details, a hidden image 'Modified.gif' is made visible. If a user clicks on another Client in the list - having forgotten to Submit - a JS function asks them if they want to save changes.

This works AOK on my pc (WAMP) but it doesn't do the Submit after the confirm() in the production environment (LAMP).

The functions involved are:
Code:
function SetModified() {
    document.getElementById("Modified").style.visibility="visible";
}
function ClearModified() {
    document.getElementById("Modified").style.visibility="hidden";
}
function CheckModified() {
    if (document.getElementById("Modified").style.visibility == "visible") {
        if (confirm("The record has been modified. Save it?")) {
            document.getElementById("ClientDetail").submit();
        }
    }
}

<form id="ClientDetail" name="ClientDetail" action="Client.php?PID=1898128264" method="post">

Does anyone have any suggestion on what's wrong, or how I might fix it?


Max Hugen
Australia
 
- Does the file "Client.php" exist on the server with the same filename case (so not "client.php" or "cLient.PhP", etc, but "Client.php")? Linux uses case-sensitive filenames, whereas Windows does not.

- Do you have any elements named "submit" in your form?

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Hi Dan

I've checked, the case is correct, and no, nothing named 'submit'. The submit button is named 'ClientDetailButton_Update'.

Max Hugen
Australia
 
FWIW, I changed the line:

document.getElementById("ClientDetail").submit();

to

var el=document.getElementById("ClientDetail");
el.submit();

Then I used Firebug to step through it, the variable 'el' was properly initialised, so I don't know what to do.

I also tried changing the case of 'submit()' to 'Submit()', but that made no difference... is this case-sensitive too? If so, which is correct pls?


Max Hugen
Australia
 
Hi Dan

The site is at Login using name: 'tektips' and pwd: 'tektips,' and this will redirect you to the problem page, Client.php.

I've pre-entered a few Clients there for you to try out. If you change any detail in a Client, and then click on a different client in the List, the function CheckModified() should be triggered.

I'm going through a steep learning curve on my first web app. :)

Thanks for your help!



Max Hugen
Australia
 
This is getting weird! It doesn't work for me in Fx 2.0.0.14, nor in IE6.

Tried it on my wife's pc on Fx2, same, not working.

Are you sure that you are NOT clicking 'Save' (ie submit) before you click on another Client in the List?

Max Hugen
Australia
 
FWIW, the friend I'm developing this app for, reports that the submit doesn't work for her either.

Max Hugen
Australia
 
I'm wondering if there is some sort of 'timing' issue going on here?

When I click the link in the Client List, 2 things should happen:
1. Submit the form after the message
2. Go to the link requested

I and my friend are in Australia, the Internet server is in the US. It takes longer (~2-3secs), than when I use localhost (~0.3sec).

The submit works when I use localhost; it also works for Dan (are you in the US?) on the US server.

It fails if I or my friend in Oz use the US server.

Does anyone think 'timing' might be an issue?

Max Hugen
Australia
 
I'm definitely not clicking "save". I'm clicking on a surname, editing it, clicking on another surname, agreeing to the popup, and repeating.

I've now tried in both IE 6 and Fx 2 from two completely different computers, and it's fine for both of them. I'm based in the UK.

I see no errors, etc... do you or your friend have any 3rd-party add-ons or security software / filtering software installed that might be causing problems?

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
P.S. What makes you think the records are not saving? If it's the fact that the list of names on the left-hand side doesn't update, then I see that as well. The records are still saved, however.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Hi Dan

I can't think of anything that would prevent the submit. Besides, I can submit using the save button, and there is a second form (the List search) which is also submitted in javascript when you "Clear" the search.

I've noticed that the List doesn't refresh properly, but only when called from function CheckModified - it works OK if you just click Save. This seems to suggest that the webpage is retrieved before the changes are committed to the db?

Being aware of this issue, when I change a record and leave it without saving, I return to the same record, and observe that the change hasn't been saved.

Max Hugen
Australia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top