|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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. |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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 !!! |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > form name question... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|