Tom's Guide Forums
  Tom's Guide Forums » PDA » PocketPC » Internet Explorer / Java Script
 




Word :   Username :  
 
Bottom
Author
 Thread : Internet Explorer / Java Script
 
More Information

Archived from groups: microsoft.public.pocketpc (More info?)

 

Hi!

I'm developing websites for mobile devices. My websites which make heavy use
of HTML forms always worked fine, also in Internet Explorer for "Pocket PC
2002". But now I have a device which runs "Windows Mobile 2003" and the
Internet Explorer which comes along with it has problems sending my form:
pressing return so that the submit button will be fired doesn't work
anymore. I have to click the submit button with the pen to make IE send the
form.

I attached the source code of my form page below.

Anybody any ideas?

Thanks in advance.

Franz

***

<HTML>

<HEAD>

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">

<TITLE>title</TITLE>

<META content="me" name="AUTHOR">

<META CONTENT="0" HTTP-EQUIV="EXPIRES">

<link href="/style.css" type="text/css" rel="stylesheet">

<SCRIPT type="text/javascript">

<!--

suspendTimeOut = 285000;

function geheZu(page)

{

document.form.action = "/servlet/" + page;

document.form.submit();

}

function activateTimeout()

{

window.setTimeout('onSuspend()', suspendTimeOut);

}

function onSuspend()

{

geheZu("suspend" );

}

text1 = "Please activate cookies in your browser!";

text2 = "Please verify that cookies are enabled in your browser!";

function verify()

{

disableButtons(true);

if (document.form.login.value == "" )

{

alert("Please enter your user name!" );

setFocus();

disableButtons(false);

return false;

}

if (document.form.password.value == "" )

{

alert("Please enter your password!" );

document.form.password.focus();

disableButtons(false);

return false;

}

if (navigator.cookieEnabled == true)

return true;

if (navigator.cookieEnabled == false)

{

alert(text1);

disableButtons(false);

return false;

}

alert(text2);

return true;

}

function disableButtons(bool)

{

document.form.resetButton.disabled = bool;

document.form.loginButton.disabled = bool;

}

function setFocus()

{

document.form.login.focus();

}

function loseFocus()

{

window.setTimeout('document.form.loginButton.focus()', suspendTimeOut);

}

//--></SCRIPT>

</HEAD>

<BODY onload="setFocus()">

<center>

<h1>My Page</h1>

<form onsubmit="return verify()" action="javascript:geheZu('login')"
method="post" name="form">

<table border="0" cellspacing="2" cellpadding="2">

<tbody>

<tr>

<td align="right"><b>User:</b></td><td><input onfocus="loseFocus()"
maxlength="14" size="14" name="login" type="text"></td>

</tr>

<tr>

<td align="right"><b>Password:</b></td><td><input onfocus="loseFocus()"
maxlength="14" size="14" name="password" type="password"></td>

</tr>

<tr>

<td colspan="2" align="center"><b>database:</b></td>

</tr>

<tr>

<td align="center" colspan="2"><SELECT
name="mandant"><OPTION>A</OPTION><OPTION>B</OPTION><OPTION>C</OPTION></SELEC
T></td>

</tr>

<tr>

<td colspan="2"></td>

</tr>

<tr>

<td align="center" colspan="2"><input value="Reset" name="resetButton"
type="reset"> 

<input value="Login" name="loginButton" type="submit"></td>

</tr>

<tr>

<td colspan="2"></td>

</tr>

<tr>

<td align="center" colspan="2"><a href="javascript:window.close()">Close
window</a></td>

</tr>

<tr>

<td align="center" colspan="2"><script type="text/javascript">

<!--

if (navigator.cookieEnabled == true)

;

else if (navigator.cookieEnabled == false)

document.write(text1.fontcolor("#FF0000" ));

else

document.write(text2.fontcolor("#FF0000" ));

//--></script></td>

</tr>

</tbody>

</table>

</form>

</center>

</BODY>

</HTML>

Related Product

Register or log in to remove.

More Information

Archived from groups: microsoft.public.pocketpc (More info?)

 

Sure. Try onKeyUp in the input field, trap and test the event for
charcode 13 (return key). It should fire for each keyUp event in the
field, then you can use this.form.submit() as normal

Cheers - Neil

On Mon, 13 Dec 2004 18:46:54 +0100, "F.L." <FL_FEE@newsgroup.nospam>
wrote:

>Hi!
>
>I'm developing websites for mobile devices. My websites which make heavy use
>of HTML forms always worked fine, also in Internet Explorer for "Pocket PC
>2002". But now I have a device which runs "Windows Mobile 2003" and the
>Internet Explorer which comes along with it has problems sending my form:
>pressing return so that the submit button will be fired doesn't work
>anymore. I have to click the submit button with the pen to make IE send the
>form.
>
>I attached the source code of my form page below.
>
>Anybody any ideas?
>
>Thanks in advance.
>
>Franz
>
>***
>
><HTML>
>
><HEAD>
>
><META http-equiv="Content-Type" content="text/html; charset=UTF-8">
>
><TITLE>title</TITLE>
>
><META content="me" name="AUTHOR">
>
><META CONTENT="0" HTTP-EQUIV="EXPIRES">
>
><link href="/style.css" type="text/css" rel="stylesheet">
>
><SCRIPT type="text/javascript">
>
><!--
>
>suspendTimeOut = 285000;
>
>function geheZu(page)
>
>{
>
>document.form.action = "/servlet/" + page;
>
>document.form.submit();
>
>}
>
>function activateTimeout()
>
>{
>
>window.setTimeout('onSuspend()', suspendTimeOut);
>
>}
>
>function onSuspend()
>
>{
>
>geheZu("suspend" );
>
>}
>
>text1 = "Please activate cookies in your browser!";
>
>text2 = "Please verify that cookies are enabled in your browser!";
>
>function verify()
>
>{
>
>disableButtons(true);
>
>if (document.form.login.value == "" )
>
>{
>
>alert("Please enter your user name!" );
>
>setFocus();
>
>disableButtons(false);
>
>return false;
>
>}
>
>if (document.form.password.value == "" )
>
>{
>
>alert("Please enter your password!" );
>
>document.form.password.focus();
>
>disableButtons(false);
>
>return false;
>
>}
>
>if (navigator.cookieEnabled == true)
>
>return true;
>
>if (navigator.cookieEnabled == false)
>
>{
>
>alert(text1);
>
>disableButtons(false);
>
>return false;
>
>}
>
>alert(text2);
>
>return true;
>
>}
>
>function disableButtons(bool)
>
>{
>
>document.form.resetButton.disabled = bool;
>
>document.form.loginButton.disabled = bool;
>
>}
>
>function setFocus()
>
>{
>
>document.form.login.focus();
>
>}
>
>function loseFocus()
>
>{
>
>window.setTimeout('document.form.loginButton.focus()', suspendTimeOut);
>
>}
>
>//--></SCRIPT>
>
></HEAD>
>
><BODY onload="setFocus()">
>
><center>
>
><h1>My Page</h1>
>
><form onsubmit="return verify()" action="javascript:geheZu('login')"
>method="post" name="form">
>
><table border="0" cellspacing="2" cellpadding="2">
>
><tbody>
>
><tr>
>
><td align="right"><b>User:</b></td><td><input onfocus="loseFocus()"
>maxlength="14" size="14" name="login" type="text"></td>
>
></tr>
>
><tr>
>
><td align="right"><b>Password:</b></td><td><input onfocus="loseFocus()"
>maxlength="14" size="14" name="password" type="password"></td>
>
></tr>
>
><tr>
>
><td colspan="2" align="center"><b>database:</b></td>
>
></tr>
>
><tr>
>
><td align="center" colspan="2"><SELECT
>name="mandant"><OPTION>A</OPTION><OPTION>B</OPTION><OPTION>C</OPTION></SELEC
>T></td>
>
></tr>
>
><tr>
>
><td colspan="2"></td>
>
></tr>
>
><tr>
>
><td align="center" colspan="2"><input value="Reset" name="resetButton"
>type="reset"> 
>
><input value="Login" name="loginButton" type="submit"></td>
>
></tr>
>
><tr>
>
><td colspan="2"></td>
>
></tr>
>
><tr>
>
><td align="center" colspan="2"><a href="javascript:window.close()">Close
>window</a></td>
>
></tr>
>
><tr>
>
><td align="center" colspan="2"><script type="text/javascript">
>
><!--
>
>if (navigator.cookieEnabled == true)
>
>;
>
>else if (navigator.cookieEnabled == false)
>
>document.write(text1.fontcolor("#FF0000" ));
>
>else
>
>document.write(text2.fontcolor("#FF0000" ));
>
>//--></script></td>
>
></tr>
>
></tbody>
>
></table>
>
></form>
>
></center>
>
></BODY>
>
></HTML>
>

More Information

Archived from groups: microsoft.public.pocketpc (More info?)

 

Well, that might work ... BUT: the problem is somewhere else! I could strip
down my website and finally found the problem: the submit button works if I
only have one input field of type "text" -- it doesn't work if there are
more! See the following valid "HTML-4.01 strict" sample webpage:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>

<title>abc</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<script type="text/javascript">

<!--

function verify()

{

alert("sending form" );

return true;

}

//-->

</script>

</head>

<body>

<form onsubmit="return verify()" action="mailto:me@somewhere.test"
method="post" name="form">

<p>

<input name="abc" type="text"><br>

<input name="def" type="text"><br>

<input value="send" name="submitButton" type="submit">

</p>

</form>

</body>

</html>

Pressing the return key after having entered something into either of the
two input fields *won't* send the form. If you remove the second input field
from the HTML code, it *does* works.

So, why did this correct behaviour work in IE for Pocket PC 2002 and why
doesn't it now in Windows Mobile 2003?

Franz

"Neil Smith [MVP Digital Media]" <neil@nospam.com> schrieb im Newsbeitrag
news:ii8sr096c1pqem9kmepmra2rgmf8hlnjja@4ax.com...
> Sure. Try onKeyUp in the input field, trap and test the event for
> charcode 13 (return key). It should fire for each keyUp event in the
> field, then you can use this.form.submit() as normal
>
> Cheers - Neil
>
> On Mon, 13 Dec 2004 18:46:54 +0100, "F.L." <FL_FEE@newsgroup.nospam>
> wrote:
>
> >Hi!
> >
> >I'm developing websites for mobile devices. My websites which make heavy
use
> >of HTML forms always worked fine, also in Internet Explorer for "Pocket
PC
> >2002". But now I have a device which runs "Windows Mobile 2003" and the
> >Internet Explorer which comes along with it has problems sending my form:
> >pressing return so that the submit button will be fired doesn't work
> >anymore. I have to click the submit button with the pen to make IE send
the
> >form.
> >
> >I attached the source code of my form page below.
> >
> >Anybody any ideas?
> >
> >Thanks in advance.
> >
> >Franz
> >
> >***
> >
> ><HTML>
> >
> ><HEAD>
> >
> ><META http-equiv="Content-Type" content="text/html; charset=UTF-8">
> >
> ><TITLE>title</TITLE>
> >
> ><META content="me" name="AUTHOR">
> >
> ><META CONTENT="0" HTTP-EQUIV="EXPIRES">
> >
> ><link href="/style.css" type="text/css" rel="stylesheet">
> >
> ><SCRIPT type="text/javascript">
> >
> ><!--
> >
> >suspendTimeOut = 285000;
> >
> >function geheZu(page)
> >
> >{
> >
> >document.form.action = "/servlet/" + page;
> >
> >document.form.submit();
> >
> >}
> >
> >function activateTimeout()
> >
> >{
> >
> >window.setTimeout('onSuspend()', suspendTimeOut);
> >
> >}
> >
> >function onSuspend()
> >
> >{
> >
> >geheZu("suspend" );
> >
> >}
> >
> >text1 = "Please activate cookies in your browser!";
> >
> >text2 = "Please verify that cookies are enabled in your browser!";
> >
> >function verify()
> >
> >{
> >
> >disableButtons(true);
> >
> >if (document.form.login.value == "" )
> >
> >{
> >
> >alert("Please enter your user name!" );
> >
> >setFocus();
> >
> >disableButtons(false);
> >
> >return false;
> >
> >}
> >
> >if (document.form.password.value == "" )
> >
> >{
> >
> >alert("Please enter your password!" );
> >
> >document.form.password.focus();
> >
> >disableButtons(false);
> >
> >return false;
> >
> >}
> >
> >if (navigator.cookieEnabled == true)
> >
> >return true;
> >
> >if (navigator.cookieEnabled == false)
> >
> >{
> >
> >alert(text1);
> >
> >disableButtons(false);
> >
> >return false;
> >
> >}
> >
> >alert(text2);
> >
> >return true;
> >
> >}
> >
> >function disableButtons(bool)
> >
> >{
> >
> >document.form.resetButton.disabled = bool;
> >
> >document.form.loginButton.disabled = bool;
> >
> >}
> >
> >function setFocus()
> >
> >{
> >
> >document.form.login.focus();
> >
> >}
> >
> >function loseFocus()
> >
> >{
> >
> >window.setTimeout('document.form.loginButton.focus()', suspendTimeOut);
> >
> >}
> >
> >//--></SCRIPT>
> >
> ></HEAD>
> >
> ><BODY onload="setFocus()">
> >
> ><center>
> >
> ><h1>My Page</h1>
> >
> ><form onsubmit="return verify()" action="javascript:geheZu('login')"
> >method="post" name="form">
> >
> ><table border="0" cellspacing="2" cellpadding="2">
> >
> ><tbody>
> >
> ><tr>
> >
> ><td align="right"><b>User:</b></td><td><input onfocus="loseFocus()"
> >maxlength="14" size="14" name="login" type="text"></td>
> >
> ></tr>
> >
> ><tr>
> >
> ><td align="right"><b>Password:</b></td><td><input onfocus="loseFocus()"
> >maxlength="14" size="14" name="password" type="password"></td>
> >
> ></tr>
> >
> ><tr>
> >
> ><td colspan="2" align="center"><b>database:</b></td>
> >
> ></tr>
> >
> ><tr>
> >
> ><td align="center" colspan="2"><SELECT
>
>name="mandant"><OPTION>A</OPTION><OPTION>B</OPTION><OPTION>C</OPTION></SELE
C
> >T></td>
> >
> ></tr>
> >
> ><tr>
> >
> ><td colspan="2"></td>
> >
> ></tr>
> >
> ><tr>
> >
> ><td align="center" colspan="2"><input value="Reset" name="resetButton"
> >type="reset"> 
> >
> ><input value="Login" name="loginButton" type="submit"></td>
> >
> ></tr>
> >
> ><tr>
> >
> ><td colspan="2"></td>
> >
> ></tr>
> >
> ><tr>
> >
> ><td align="center" colspan="2"><a href="javascript:window.close()">Close
> >window</a></td>
> >
> ></tr>
> >
> ><tr>
> >
> ><td align="center" colspan="2"><script type="text/javascript">
> >
> ><!--
> >
> >if (navigator.cookieEnabled == true)
> >
> >;
> >
> >else if (navigator.cookieEnabled == false)
> >
> >document.write(text1.fontcolor("#FF0000" ));
> >
> >else
> >
> >document.write(text2.fontcolor("#FF0000" ));
> >
> >//--></script></td>
> >
> ></tr>
> >
> ></tbody>
> >
> ></table>
> >
> ></form>
> >
> ></center>
> >
> ></BODY>
> >
> ></HTML>
> >
>

More Information

Archived from groups: microsoft.public.pocketpc (More info?)

 

AFAIK pressing return to submit a form isn't part of any web specification,
so you shouldn't really depend on it working in all browsers. IMHO having it
only work when there is a single text input field is sensible - people often
accidentally press return after filling a field, when they still need to
fill more fields, which is a pain.

Tony

F.L. wrote:
> Well, that might work ... BUT: the problem is somewhere else! I could
> strip down my website and finally found the problem: the submit
> button works if I only have one input field of type "text" -- it
> doesn't work if there are more! See the following valid "HTML-4.01
> strict" sample webpage:
>

More Information

Archived from groups: microsoft.public.pocketpc (More info?)

 

That's not the "correct" bahaviour, it's the default behaviour for
internet explorer on the desktop. You have become confused with what
IE does and what the specification is for forms. Check this for clues
: http://support.microsoft.com/defau [...] -us;298498

"However, not all browsers behave the same way, and you may want to
disable this behavior". As they say, this is IE which does this not
"other browsers" in the browser culture.

The default behaviour in desktop IE only takes place if there is one
input type="text" form element to submit. Otherwise the browser falls
back to the standard behaviour. This is why there are tutorials on
www.irt.org using javascript to submit forms on enter which have
multiple input elelents.

For an excruciatingly detailed explanation of these differences see
here http://ppewww.ph.gla.ac.uk/~flavel [...] stion.html

The correct specification as provided by W3C is under the tabindex
section (down the bottom in green text) : `the "tab" key is used for
navigation and the "enter" key is used to activate a selected element'
http://www.w3.org/TR/REC-html40/in [...] #h-17.11.1

The fact that pocket IE has no use for a tabindex is a side-effect of
the pen-based navigation and compromises made there to make the
browser usable.

HTH

Cheers - Neil



On Wed, 15 Dec 2004 15:06:00 +0100, "F.L." <FL_FEE@newsgroup.nospam>
wrote:

>Well, that might work ... BUT: the problem is somewhere else! I could strip
>down my website and finally found the problem: the submit button works if I
>only have one input field of type "text" -- it doesn't work if there are
>more!
>
>Pressing the return key after having entered something into either of the
>two input fields *won't* send the form. If you remove the second input field
>from the HTML code, it *does* works.
>
>So, why did this correct behaviour work in IE for Pocket PC 2002 and why
>doesn't it now in Windows Mobile 2003?

More Information

Archived from groups: microsoft.public.pocketpc (More info?)

 

First of all: thanks for your detailed answer. About two years ago when I
was coding my forms, I once read that the submit button acts like the
default button in a regular Windows application dialog: pressing return
fires the default button. Well, now I know that this is only true for forms
with one input field.

But unfortunately, the "workaround" you provided in your first reply doesn't
work: the "onKeyPress" event is not supported by PIE (Pocket Internet
Explorer):

http://groups.google.com/groups?hl [...] 13.phx.gbl

And if you have a look at the document mentioned ...

http://www.microsoft.com/mobile/de [...] s/html.doc

.... you will see (caption "<INPUT TYPE=text> element/object" ) that PIE only
supports the "onClick" event for input fields.

Do you have any ideas?

Thanks in advance,

Franz.

"Neil Smith [MVP Digital Media]" <neil@nospam.com> schrieb im Newsbeitrag
news:dvu0s0lmju2topi3ebqfsg6d1o4o9kaejo@4ax.com...
> That's not the "correct" bahaviour, it's the default behaviour for
> internet explorer on the desktop. You have become confused with what
> IE does and what the specification is for forms. Check this for clues
> : http://support.microsoft.com/defau [...] -us;298498
>
> "However, not all browsers behave the same way, and you may want to
> disable this behavior". As they say, this is IE which does this not
> "other browsers" in the browser culture.
>
> The default behaviour in desktop IE only takes place if there is one
> input type="text" form element to submit. Otherwise the browser falls
> back to the standard behaviour. This is why there are tutorials on
> www.irt.org using javascript to submit forms on enter which have
> multiple input elelents.
>
> For an excruciatingly detailed explanation of these differences see
> here http://ppewww.ph.gla.ac.uk/~flavel [...] stion.html
>
> The correct specification as provided by W3C is under the tabindex
> section (down the bottom in green text) : `the "tab" key is used for
> navigation and the "enter" key is used to activate a selected element'
> http://www.w3.org/TR/REC-html40/in [...] #h-17.11.1
>
> The fact that pocket IE has no use for a tabindex is a side-effect of
> the pen-based navigation and compromises made there to make the
> browser usable.
>
> HTH
>
> Cheers - Neil
>
>
>
> On Wed, 15 Dec 2004 15:06:00 +0100, "F.L." <FL_FEE@newsgroup.nospam>
> wrote:
>
> >Well, that might work ... BUT: the problem is somewhere else! I could
strip
> >down my website and finally found the problem: the submit button works if
I
> >only have one input field of type "text" -- it doesn't work if there are
> >more!
> >
> >Pressing the return key after having entered something into either of the
> >two input fields *won't* send the form. If you remove the second input
field
> >from the HTML code, it *does* works.
> >
> >So, why did this correct behaviour work in IE for Pocket PC 2002 and why
> >doesn't it now in Windows Mobile 2003?
>

More Information

Archived from groups: microsoft.public.pocketpc (More info?)

 

Read again : I said to use onKeyUp

Cheers - Neil

On Mon, 20 Dec 2004 10:02:43 +0100, "F.L." <FL_FEE@newsgroup.nospam>
wrote:

>First of all: thanks for your detailed answer. About two years ago when I
>was coding my forms, I once read that the submit button acts like the
>default button in a regular Windows application dialog: pressing return
>fires the default button. Well, now I know that this is only true for forms
>with one input field.
>
>But unfortunately, the "workaround" you provided in your first reply doesn't
>work: the "onKeyPress" event is not supported by PIE (Pocket Internet
>Explorer):
>
>http://groups.google.com/groups?hl=de&lr=&selm=%236htjjyUEHA.556%40tk2msftngp13.phx.gbl
>
>And if you have a look at the document mentioned ...
>
>http://www.microsoft.com/mobile/developer/technicalarticles/html.doc
>
>... you will see (caption "<INPUT TYPE=text> element/object" ) that PIE only
>supports the "onClick" event for input fields.
>
>Do you have any ideas?
>
>Thanks in advance,
>
>Franz.
>
>"Neil Smith [MVP Digital Media]" <neil@nospam.com> schrieb im Newsbeitrag
>news:dvu0s0lmju2topi3ebqfsg6d1o4o9kaejo@4ax.com...
>> That's not the "correct" bahaviour, it's the default behaviour for
>> internet explorer on the desktop. You have become confused with what
>> IE does and what the specification is for forms. Check this for clues
>> : http://support.microsoft.com/defau [...] -us;298498
>>
>> "However, not all browsers behave the same way, and you may want to
>> disable this behavior". As they say, this is IE which does this not
>> "other browsers" in the browser culture.
>>
>> The default behaviour in desktop IE only takes place if there is one
>> input type="text" form element to submit. Otherwise the browser falls
>> back to the standard behaviour. This is why there are tutorials on
>> www.irt.org using javascript to submit forms on enter which have
>> multiple input elelents.
>>
>> For an excruciatingly detailed explanation of these differences see
>> here http://ppewww.ph.gla.ac.uk/~flavel [...] stion.html
>>
>> The correct specification as provided by W3C is under the tabindex
>> section (down the bottom in green text) : `the "tab" key is used for
>> navigation and the "enter" key is used to activate a selected element'
>> http://www.w3.org/TR/REC-html40/in [...] #h-17.11.1
>>
>> The fact that pocket IE has no use for a tabindex is a side-effect of
>> the pen-based navigation and compromises made there to make the
>> browser usable.
>>
>> HTH
>>
>> Cheers - Neil
>>
>>
>>
>> On Wed, 15 Dec 2004 15:06:00 +0100, "F.L." <FL_FEE@newsgroup.nospam>
>> wrote:
>>
>> >Well, that might work ... BUT: the problem is somewhere else! I could
>strip
>> >down my website and finally found the problem: the submit button works if
>I
>> >only have one input field of type "text" -- it doesn't work if there are
>> >more!
>> >
>> >Pressing the return key after having entered something into either of the
>> >two input fields *won't* send the form. If you remove the second input
>field
>> >from the HTML code, it *does* works.
>> >
>> >So, why did this correct behaviour work in IE for Pocket PC 2002 and why
>> >doesn't it now in Windows Mobile 2003?
>>
>

More Information

Archived from groups: microsoft.public.pocketpc (More info?)

 

OK my mistake, sorry. I looked back more closely at the work I did
with this. Here's a working workaround :

================================

<html>
<head>
<title>Simulate keyup changes</title>
<script language="javascript">
// Set initial value to check against
var curvalue="";
function getTimeout() {
dv=document.forms["keys"].send.value;
df=document.forms["keys"].get;
if (dv !=curvalue) {
curvalue=dv;
// Change value to current text box content
df.value=dv;
// Or use your own function here instead
}
// Repeat ever 50 millisec or interval of your choice
window.setTimeout(getTimeout,50);
}
</script>
</head>

<body onload="getTimeout()">

<form name="keys" id="keys">
Input : <input type="text" name="send" id="send" size="12"
maxlength="24" />


Output : <input type="text" name="get" id="get" size="12"
maxlength="24" />
</form>

</body>
</html>


================================
Cheers - Neil
On Mon, 20 Dec 2004 10:02:43 +0100, "F.L." <FL_FEE@newsgroup.nospam>
wrote:

>First of all: thanks for your detailed answer. About two years ago when I
>was coding my forms, I once read that the submit button acts like the
>default button in a regular Windows application dialog: pressing return
>fires the default button. Well, now I know that this is only true for forms
>with one input field.
>
>But unfortunately, the "workaround" you provided in your first reply doesn't
>work: the "onKeyPress" event is not supported by PIE (Pocket Internet
>Explorer):
>
>http://groups.google.com/groups?hl=de&lr=&selm=%236htjjyUEHA.556%40tk2msftngp13.phx.gbl
>
>And if you have a look at the document mentioned ...
>
>http://www.microsoft.com/mobile/developer/technicalarticles/html.doc
>
>... you will see (caption "<INPUT TYPE=text> element/object" ) that PIE only
>supports the "onClick" event for input fields.
>
>Do you have any ideas?
>
>Thanks in advance,
>
>Franz.
>
>"Neil Smith [MVP Digital Media]" <neil@nospam.com> schrieb im Newsbeitrag
>news:dvu0s0lmju2topi3ebqfsg6d1o4o9kaejo@4ax.com...
>> That's not the "correct" bahaviour, it's the default behaviour for
>> internet explorer on the desktop. You have become confused with what
>> IE does and what the specification is for forms. Check this for clues
>> : http://support.microsoft.com/defau [...] -us;298498
>>
>> "However, not all browsers behave the same way, and you may want to
>> disable this behavior". As they say, this is IE which does this not
>> "other browsers" in the browser culture.
>>
>> The default behaviour in desktop IE only takes place if there is one
>> input type="text" form element to submit. Otherwise the browser falls
>> back to the standard behaviour. This is why there are tutorials on
>> www.irt.org using javascript to submit forms on enter which have
>> multiple input elelents.
>>
>> For an excruciatingly detailed explanation of these differences see
>> here http://ppewww.ph.gla.ac.uk/~flavel [...] stion.html
>>
>> The correct specification as provided by W3C is under the tabindex
>> section (down the bottom in green text) : `the "tab" key is used for
>> navigation and the "enter" key is used to activate a selected element'
>> http://www.w3.org/TR/REC-html40/in [...] #h-17.11.1
>>
>> The fact that pocket IE has no use for a tabindex is a side-effect of
>> the pen-based navigation and compromises made there to make the
>> browser usable.
>>
>> HTH
>>
>> Cheers - Neil
>>
>>
>>
>> On Wed, 15 Dec 2004 15:06:00 +0100, "F.L." <FL_FEE@newsgroup.nospam>
>> wrote:
>>
>> >Well, that might work ... BUT: the problem is somewhere else! I could
>strip
>> >down my website and finally found the problem: the submit button works if
>I
>> >only have one input field of type "text" -- it doesn't work if there are
>> >more!
>> >
>> >Pressing the return key after having entered something into either of the
>> >two input fields *won't* send the form. If you remove the second input
>field
>> >from the HTML code, it *does* works.
>> >
>> >So, why did this correct behaviour work in IE for Pocket PC 2002 and why
>> >doesn't it now in Windows Mobile 2003?
>>
>

More Information

Archived from groups: microsoft.public.pocketpc (More info?)

 

I'm sorry Neil, but your "workaround" has nothing to do with catching the
return key: it simply copies text from one input field to another one.
There's no way to detect that someone hit return.

Thank you

Franz



"Neil Smith [MVP Digital Media]" <neil@nospam.com> schrieb im Newsbeitrag
news:82ads010bajrfo58nplk93cc3b7oi8a6ai@4ax.com...
> OK my mistake, sorry. I looked back more closely at the work I did
> with this. Here's a working workaround :
>
> ================================
>
> <html>
> <head>
> <title>Simulate keyup changes</title>
> <script language="javascript">
> // Set initial value to check against
> var curvalue="";
> function getTimeout() {
> dv=document.forms["keys"].send.value;
> df=document.forms["keys"].get;
> if (dv !=curvalue) {
> curvalue=dv;
> // Change value to current text box content
> df.value=dv;
> // Or use your own function here instead
> }
> // Repeat ever 50 millisec or interval of your choice
> window.setTimeout(getTimeout,50);
> }
> </script>
> </head>
>
> <body onload="getTimeout()">
>
> <form name="keys" id="keys">
> Input : <input type="text" name="send" id="send" size="12"
> maxlength="24" />
>

> Output : <input type="text" name="get" id="get" size="12"
> maxlength="24" />
> </form>
>
> </body>
> </html>
>
>
> ================================
> Cheers - Neil
> On Mon, 20 Dec 2004 10:02:43 +0100, "F.L." <FL_FEE@newsgroup.nospam>
> wrote:
>
> >First of all: thanks for your detailed answer. About two years ago when I
> >was coding my forms, I once read that the submit button acts like the
> >default button in a regular Windows application dialog: pressing return
> >fires the default button. Well, now I know that this is only true for
forms
> >with one input field.
> >
> >But unfortunately, the "workaround" you provided in your first reply
doesn't
> >work: the "onKeyPress" event is not supported by PIE (Pocket Internet
> >Explorer):
> >
>
>http://groups.google.com/groups?hl=de&lr=&selm=%236htjjyUEHA.556%40tk2msftn
gp13.phx.gbl
> >
> >And if you have a look at the document mentioned ...
> >
> >http://www.microsoft.com/mobile/developer/technicalarticles/html.doc
> >
> >... you will see (caption "<INPUT TYPE=text> element/object" ) that PIE
only
> >supports the "onClick" event for input fields.
> >
> >Do you have any ideas?
> >
> >Thanks in advance,
> >
> >Franz.
> >
> >"Neil Smith [MVP Digital Media]" <neil@nospam.com> schrieb im Newsbeitrag
> >news:dvu0s0lmju2topi3ebqfsg6d1o4o9kaejo@4ax.com...
> >> That's not the "correct" bahaviour, it's the default behaviour for
> >> internet explorer on the desktop. You have become confused with what
> >> IE does and what the specification is for forms. Check this for clues
> >> : http://support.microsoft.com/defau [...] -us;298498
> >>
> >> "However, not all browsers behave the same way, and you may want to
> >> disable this behavior". As they say, this is IE which does this not
> >> "other browsers" in the browser culture.
> >>
> >> The default behaviour in desktop IE only takes place if there is one
> >> input type="text" form element to submit. Otherwise the browser falls
> >> back to the standard behaviour. This is why there are tutorials on
> >> www.irt.org using javascript to submit forms on enter which have
> >> multiple input elelents.
> >>
> >> For an excruciatingly detailed explanation of these differences see
> >> here http://ppewww.ph.gla.ac.uk/~flavel [...] stion.html
> >>
> >> The correct specification as provided by W3C is under the tabindex
> >> section (down the bottom in green text) : `the "tab" key is used for
> >> navigation and the "enter" key is used to activate a selected element'
> >> http://www.w3.org/TR/REC-html40/in [...] #h-17.11.1
> >>
> >> The fact that pocket IE has no use for a tabindex is a side-effect of
> >> the pen-based navigation and compromises made there to make the
> >> browser usable.
> >>
> >> HTH
> >>
> >> Cheers - Neil
> >>
> >>
> >>
> >> On Wed, 15 Dec 2004 15:06:00 +0100, "F.L." <FL_FEE@newsgroup.nospam>
> >> wrote:
> >>
> >> >Well, that might work ... BUT: the problem is somewhere else! I could
> >strip
> >> >down my website and finally found the problem: the submit button works
if
> >I
> >> >only have one input field of type "text" -- it doesn't work if there
are
> >> >more!
> >> >
> >> >Pressing the return key after having entered something into either of
the
> >> >two input fields *won't* send the for