SunQuest
 
           JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old July 20th, 2004, 01:19 PM
sharyn sharyn is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 32 sharyn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 53 m 17 sec
Reputation Power: 5
form name question...

Well, it's actually 2 questions...
1] I have an intermediate file that reads an x & y coordinate in the form of "intermediate.htm?x,y" then jumps to a different page with the url "mainpage.php?x=xval&y=yval&otherstuffhere=stuff"
I am using a submit script to do the jump

Code:
  function Send2Inter(x,y,uq)
   {
 	window.location.href="MainPage.php?xval=" + x + "&yval=" + y + "&" + uq;
 	document.Test.submit();
   }
 


There is no form declaration (form Test does not exist) and NS doesn't care, I get the correct results.. but IE cares... I get an error "Document Test is null or not an object." Is there any way to get around this?


2] How can I get the name of a form if I don't know it ? Is there some command like document.form.name.value?

Thanks a mill
- sharyn

Reply With Quote
  #2  
Old July 20th, 2004, 01:43 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
If you don't know the name of the form, why are you calling the form by name? Seems weird. You can create form tags, give the form a name, and use that name in your script. Or you can use document.forms[0].submit() if there's only one form on the page.
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #3  
Old July 20th, 2004, 01:47 PM
BurhanKhan BurhanKhan is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 44 BurhanKhan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
U can do these:

1- omit .href
2- omit document.Test.submit();

I use this in IE, and not test in any other browser.I think it will do same as your desire.
Do not think about test form.

Your function should look like this:

function Send2Inter(x,y,uq)
{
window.location="MainPage.php?xval=" + x + "&yval=" + y + "&" + uq;
}


Burhan

Reply With Quote
  #4  
Old July 20th, 2004, 02:04 PM
sharyn sharyn is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 32 sharyn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 53 m 17 sec
Reputation Power: 5
DHouston, I was thinking that if I called that script from multiple forms I would determine the name of the form in the script, but you are right... If I am calling the script from a form, I should know the name of the form and just pass it into the script...

BurhanKhan - Perfect !!!! Thanks !!!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > form name question...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway