Wrox Programmer Forums
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 30th, 2005, 10:07 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

i'm not too sure what you mean joe.

i tried this:

Code:
function submitvalues()
{
if ((document.fexp.multileg.value == "true")&&(document.fexp.submitcounter.value == "true")&&(document.fexp.crmpicco.value != "no"))
    {
        document.fexp.multileg.value == "false"
        document.fexp.submitcounter.value == "false"
        document.fexp.submit();
        document.fexp.crmpicco.value = "no"
    }
}
but it doesnt work, just continuous submission again :-(

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
 
Old March 30th, 2005, 10:37 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Please take this in the best possible way but you really need to take a step back and learn some of the basics of web development. Taking a day or two to learn the basics is going to save you ten times that amount in patching and modifying code that is inherently poor.

In your page at the moment you have some server side script that sets the value of "multileg", you then insert this into your hidden field:
Code:
value="<%=multileg%>"
So when you submit the form it resets this to "true" and you go into your endless loop. Either you need to set this to false after the first submission or you need to re-evaluate why you are doing all this and re-design the application.

Good Luck




--

Joe (Microsoft MVP - XML)
 
Old March 30th, 2005, 11:15 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

"Either you need to set this to false after the first submission"

how would i code this and where?

Also discussed here:

http://www.codingforums.com/showthre...953#post290953

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
 
Old March 30th, 2005, 11:18 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Without seeing the whole page AND KNOWING THE REQUIREMENTS I've no idea.

--

Joe (Microsoft MVP - XML)
 
Old March 30th, 2005, 11:37 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default



=
 
Old March 30th, 2005, 11:40 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

the requirements are:

the form must be submitted on load, but only ONCE:

Code:
<input type="submit" name="button" id="button" value="SUBMIT" onClick="javascript:processleg('multileg','express')">
or even better the above button could be pressed onload?



www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
 
Old March 31st, 2005, 07:34 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

Heres the code to yesterdays problem, joe: FIXED:

Code:
<body bgcolor="#f5f5f5" onload="setframe();document.fexp.depapt.focus();<%if cint(count) = 0 and trim(request.form("pass")) <> "true" then%>processleg('multileg','express');<%end if%>">
processleg is a function in my JavaScript include file.

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
 
Old March 31st, 2005, 07:35 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

BTW i take no offense :-)

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt





Similar Threads
Thread Thread Starter Forum Replies Last Post
display Null or Not an object error kishy449 Classic ASP Professional 1 September 4th, 2007 01:21 PM
Error: (variable) is null or not an object alisonchase JSP Basics 1 February 14th, 2005 07:14 AM
Error inserting NULL value from form saturdave ASP.NET 1.x and 2.0 Application Design 2 January 12th, 2005 12:47 PM
null exception error abhit_kumar JSP Basics 4 January 5th, 2005 05:26 PM
Error: 'style.display' is null or not an object Adam H-W Javascript 4 April 22nd, 2004 08:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.