473,405 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

"Missing name after . operator "

Expand|Select|Wrap|Line Numbers
  1. <form name="return" method="post" action="a.jsp">
  2.             <input type="hidden" name="name" value="bb">
  3.  
  4.         </form>
  5.         <script language="JavaScript" type="text/javascript">
  6.             document.return.submit();
  7.         </script>

The code makes an auto-submit form.
In Firefox is working, but in Internet Explorer, it doesn't make the redirect thing.

In Netbeans I receive the message "Missing name after . operator "

What is the problem?
Aug 12 '09 #1
8 4990
gits
5,390 Expert Mod 4TB
return is a keyword ... you shouldn't use it .... change it to 'returnForm' or similar
Aug 12 '09 #2
So instead of
Expand|Select|Wrap|Line Numbers
  1. <form name="return"
  2. document.return.submit();
I should use

Expand|Select|Wrap|Line Numbers
  1. <form name="blabla"
  2. document.blabla.submit();

Is not working. :(
Aug 12 '09 #3
Markus
6,050 Expert 4TB
Try this (using document.getElementById())

Expand|Select|Wrap|Line Numbers
  1. <form id="returnForm" method="post" action="a.jsp">
  2.             <input type="hidden" name="name" value="bb">
  3.  
  4.         </form>
  5.         <script language="JavaScript" type="text/javascript">
  6.             document.getElementById('returnForm').submit();
  7.         </script>
  8.  
Aug 12 '09 #4
Now is not working in Firefox, but in Internet Explorer is working. HAHAHA
Aug 12 '09 #5
gits
5,390 Expert Mod 4TB
what about using the 'returnForm' as name attrib again and then:

Expand|Select|Wrap|Line Numbers
  1. document.forms['returnForm'].submit();
Aug 13 '09 #6
LAT78
2
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. if(!function_exists('BrowserDetection')){
  3.     function BrowserDetection($which_test){
  4.         $browser='';
  5.         $dom_browser='';
  6.         $navigator_user_agent=(isset($_SERVER['HTTP_USER_AGENT'])) ? strtolower($_SERVER['HTTP_USER_AGENT']) : '';
  7.         if(stristr($navigator_user_agent,"opera")){
  8.             $browser='opera';
  9.             $dom_browser=true;
  10.         }elseif(stristr($navigator_user_agent,"msie 4")){
  11.             $browser='msie4';
  12.             $dom_browser=false;
  13.         }elseif(stristr($navigator_user_agent,"msie")){
  14.             $browser='msie';
  15.             $dom_browser=true;
  16.         }elseif((stristr($navigator_user_agent,"konqueror")) || (stristr($navigator_user_agent, "safari"))){
  17.             $browser='safari';
  18.             $dom_browser=true;
  19.         }elseif(stristr($navigator_user_agent,"gecko")){
  20.             $browser='mozilla';
  21.             $dom_browser=true;
  22.         }elseif(stristr($navigator_user_agent,"mozilla/4")){
  23.             $browser='ns4';
  24.             $dom_browser=false;
  25.         }else{
  26.             $dom_browser=false;
  27.             $browser=false;
  28.         }
  29.         if($which_test=='browser'){
  30.             return $browser;
  31.         }elseif($which_test=='dom'){
  32.             return $dom_browser;
  33.         }
  34.     }
  35. }?>
  36. <form name="SecretForm" method="post" action="a.jsp">
  37.   <input type="hidden" name="name" value="bb">
  38.   <input type="submit" value="submit">
  39. </form><?
  40. if(browserdetection('browser')=="msie"){?>
  41. <script language="JavaScript" type="text/javascript"><!--
  42.     document.forms('SecretForm').submit()
  43. //--></script><?
  44. }elseif(BrowserDetection('browser')=="mozilla"){?>
  45. <script language="JavaScript" type="text/javascript"><!--
  46.     document.SecretForm.submit();
  47. //--></script><?
  48. }
Jul 31 '10 #7
gits
5,390 Expert Mod 4TB
should that be useful for a form auto-submit? ... as Markus suggested by just giving the form an id and then using:
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('formId').submit();
everything should work without any browser-detection. another option would be the reference in post #6. for a form submit no browser detection should be needed.
Jul 31 '10 #8
LAT78
2
yes but it doest work one my site and i have to use browser for the user not have to see a blank site with a submit button.
Aug 12 '10 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

34
by: Pmb | last post by:
I've been working on creating a Complex class for my own learning purpose (learn through doing etc.). I'm once again puzzled about something. I can't figure out how to overload the assignment...
9
by: Emanuele Aina | last post by:
I have some code which does a lot of "in" on lists containing objects with no __eq__ defined. It all goes fast until I add the __lt__() method: then I have a slowdown comparable to the one I get...
8
by: av | last post by:
i have my little string class, now i want do define something like this but for doing it i have to write sstream& operator+(char* a, char* b){} but compiler say something like...
1
by: BobPaul | last post by:
I'm following code out of a howto book and this is really bugging me. This header file was created by VStudio 6.0 when I did a "Right Click: Add Member Function" CLine is a class I wrote (per the...
2
by: sfrvn | last post by:
I am embarrassed to say I cannot make this work. Recently upgraded to Access 2003, but do not know if that part of problem (AKA 'syntax change'). Would someone be kind enough to lead me by the...
5
by: Gianni Mariani | last post by:
I'm hoping someone can tell me why using member address of works and why using the dot operator does not in the code below. The code below uses the template function resolution mechanism to...
14
by: Jess | last post by:
Hi, I read about operator overloading and have a question regarding "operator->()". If I have two classes like this: struct A{ void f(); }; struct B{
2
by: alice123 | last post by:
I have a DataTable with ColumnName: ++CustomerName++. when i try to filter this DataTable as string columnName=Table.Columns.ToString(); DataRow row = Table.Select(columnName + " = 'Alice'); ...
3
by: tvnaidu | last post by:
I compiled tinyxml files (.cpp files) and when I am linking to create final exe in Linux, I am getting lot of errors saying "undefiend reference" to "operator new" and "delete", any idea?. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.