Tom's Guide > Forum > PDA > Windows Mobile > Internet Explorer / Java Script

Internet Explorer / Java Script

Forum PDA : Windows Mobile - Internet Explorer / Java Script

TomsGuide.com: Over 800,000 questions and answers to address all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

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>

Sponsored Links
Register or log in to remove.

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>
>

Reply to Anonymous

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>
> >
>

Reply to Anonymous

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:
>

Reply to Anonymous

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?

Reply to Anonymous

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?
>

Reply to Anonymous

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?
>>
>

Reply to Anonymous

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?
>>
>

Reply to Anonymous

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 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?
> >>
> >
>

Reply to Anonymous

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

 

It was a proof of concept. You have to apply your existing knowledge
to achieve a solution. Have you no imagination ? ;-))

Right try this - make the input box a textarea with rows="1" and
cols="20" (or desired size).

Change the bit where it says "insert your function here" to what
should be obvious - a regex.

if (dv.match("\r|\n" )) {
alert("Matched return" );
}

And then replace the alert with whatever code you're intending to use
(which I won't write for you ;-)

Cheers - Neil

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

>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 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?
>> >>
>> >
>>
>

Reply to Anonymous

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

 

Neil Smith [MVP Digital Media] wrote:
> It was a proof of concept. You have to apply your existing knowledge
> to achieve a solution. Have you no imagination ? ;-))

Well, I didn't think of textareas ... but with input fields of
type text, the return character is never entered when the return
key is hit, so there's no way the detect it.

> Right try this - make the input box a textarea with rows="1" and
> cols="20" (or desired size).
>
> Change the bit where it says "insert your function here" to what
> should be obvious - a regex.
>
> if (dv.match("\r|\n" )) {
> alert("Matched return" );
> }
>
> And then replace the alert with whatever code you're intending to use
> (which I won't write for you ;-)

I never expected from you to write my code. I only needed a hint
into the right direction.

Honestly said, I'm not really fond of your solution provided. I
don't like such kind of polling. So I came up with my own idea:
since my desired behaviour works with one input field and since I
have no more than two input fields on my pages, I split up each
form into two and made each of the two submit the whole page --
and this finally works.

Though, thanks for your support Neil. Merry Christmas! ;-)

Franz.

Reply to Anonymous

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

 

On Tue, 21 Dec 2004 16:42:15 +0100, "F.L." <FL_FEE@newsgroup.nospam>
wrote:

>Honestly said, I'm not really fond of your solution provided. I
>don't like such kind of polling.

Sure thing. It's only necessary because there's no 'onchange' event
fired until your form field loses focus (by which time it's too late
to determine the keystrokes on-the-fly).

>So I came up with my own idea:
>since my desired behaviour works with one input field and since I
>have no more than two input fields on my pages, I split up each
>form into two and made each of the two submit the whole page --
>and this finally works.

Cool. That's the best way (using hidden fields is usual)

>Though, thanks for your support Neil. Merry Christmas! ;-)

Joyeaux noel, indeed. Time for the pub ?
Cheers - Neil

Reply to Anonymous
Tom's Guide > Forum > PDA > Windows Mobile > Internet Explorer / Java Script
Go to:

There are 17 identified and unidentified users. To see the list of identified users, Click here.

Please mind

You are about to answer a thread that has been inactive for more than 6 months.
If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.

Add a reply Cancel
Google ads