ASP - Checkbox to restore original values

hi all,

a problem that i seem unable to fix :(

i am working on an asp page that was designed by someone else for my company.

its a booking form which you can ammend/load etc...

anyway so there is a tickbox at the top left of the page (see attached image) where the client unticks this if they are not using the default address, this part of the function works no problem... HOWEVER when they tick the box again it should restore these values which at the moment it does not....

please find attached the code for the page in question (had to change extension from asp to txt due to upload restrictions). if you would like to see the function itself you can go to:

http://choiceglobaloptions.co.uk/client_login/

use the client id: monkeymagic

click to make a new booking.

and you will see the problem.

any light shed on this and i will forever be in debt to you! its driving me crazy!

thanks,

Arran screendumpMain.txt
gaa18Asked:
Who is Participating?
 
Big MontyConnect With a Mentor Senior Web Developer / CEO of ExchangeTree.org Commented:
when you say "it doesnt work", what do you mean? the values dont get re-populated? i'm using IE8 and the values DO re-appear, I also notice a javascript error occurring that states an object is required for line 345
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
looks to be a ajavascript error in this function:

function CancelAltShipFrom()
{
document.getElementById('ACCLIENT').style.background='cyan'
document.getElementById('ACCLIENT').value=document.getElementById('OrigACCLIENT').value
document.getElementById('ACAD1').style.background='cyan'
document.getElementById('ACAD1').value=document.getElementById('OrigACAD1').value
document.getElementById('ACAD2').style.background='cyan'
document.getElementById('ACAD2').value=document.getElementById('OrigACAD2').value
document.getElementById('ACAD3').style.background='cyan'
document.getElementById('ACAD3').value=document.getElementById('OrigACAD3').value
document.getElementById('ACAD4').style.background='cyan'
document.getElementById('ACAD4').value=document.getElementById('OrigACAD4').value
document.getElementById('ACCONTACT').value=document.getElementById('OrigACCONTACT').value
document.getElementById('ACTEL').value=document.getElementById('OrigACTEL').value
document.getElementById('ACFAX').value=document.getElementById('OrigACFAX').value
document.getElementById('ACEMAIL').value=document.getElementById('OrigACEMAIL').value
document.getElementById('AltShip').style.background='cyan'
document.getElementById('Cancel').style.visibility='hidden'
document.getElementById('AltLookUp').style.visibility='hidden'
document.getElementById('AltShipFlag').value='NO'
}

i believe the error is occurring on the boled line, try commenting it out for now and see if it works
0
 
sammySeltzerCommented:
Actually it is on this line:

document.getElementById('AltShip').style.background='cyan'

Either comment it out since it is not used anywhere or add it.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
gaa18Author Commented:
no success :( it clears down but doesnt put the data back :(
0
 
gaa18Author Commented:
i tried both ideas but still same thing :(
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
can you try commenting out all of the lines in that function? or comment out wherever the function is being called from?
0
 
gaa18Author Commented:
where do you mean?
0
 
gaa18Author Commented:
the function is being called from the tick box action.....

i tried commenting out all the other lines and it didnt work :(
0
 
gaa18Author Commented:
it does work on internet explorer you genius you! but why not firefox?

i fixed the code error that IE brought up.

now the error i get with firefox is this:
Error: document.getElementById("ACCLIENT") is null
Source File: http://choiceglobaloptions.co.uk/GlobalBookings/Main.asp?action=update
Line: 330
0
 
Big MontyConnect With a Mentor Senior Web Developer / CEO of ExchangeTree.org Commented:
genius I am not, I just happened to be using a browser you havent tested :)

is there a field anywhere on the page with an ID of ACCLIENT? basically, that error says it cant find a reference to that field
0
 
sammySeltzerCommented:
@The_Big_Daddy is correct.

It is clearing and repopulating without errors, atleast for me anyway.

You want want to clear out your cookies or refresh the browser and try again.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I've requested that this question be deleted for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
I provided the reason why he was getting an error (#35721532), without being able to see all of the code I cant do much more, but I do believe I provided the solution for him.
0
 
sammySeltzerCommented:
I agree with The_Big_Daddy.

My own issue with ongoing recommendation to delete a question and give no points to the experts who provide proposed solution is that the users who ask the questions are the ones that abandoned it.

It is very hard to tell whether the proposed solutions has solved their problems or not.

Besides, if you keep deleting questions that are abandoned by the OP where solutions have been provided, then there will be no incentive for them to acknowledge the help that have been given to them.

I for one, like many other helpers here don't really care about the points but the OPs need to be encouraged to give feedback to the solutions that been proposed for them.

0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
i agree totally, I dont do this for points, I do to help out people. If the OP just leaves the question, they have no motivation to recognize, and finalize, their questions.
0
All Courses

From novice to tech pro — start learning today.