Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Application Programming


    

Blue Forest http://www.lslnet.com at 8:28 on August 25, 2006

Javascript is learning, ladies doubts!

Universal Form certification process from a short cut to facilitate learning, but they still pass, please advise!
Initial Operation Alert "object does not exist", is the language problem if (trim (ele.value) ====== "")
After the re-no response.

"SCRIPT LANGUAGE=" Javascript "TYPE=" TEXT/JAVASCRIPT ""
<!--
/*** Inspection string ***/
Function checkString ()
{
Var ele=event.srcElement;
If (ele.valueType!=null)
{
If (ele.mustInput== ele.mustInput!=null, named "true")
  {
If (trim (ele.value) ====== "")
   {
If (ele.objName!=null)
    {
Alert (ele.objName+ "not empty");
    }
Else
    {
Alert ( "the text box bound to lose Fields");
    }
Ele.focus ();
Return false;
   }
  }
If (ele.stringLen!=null, named !isNaN (ele.stringLen))
  {
Var value=new String (ele.value);
If (value.length>parseInt (ele.stringLen))
   {
Alert ( "You imported" +convertNullToSpace (ele.objName) + "The maximum length of the" +ele.stringLen);
Ele.focus ();
Return false;
   }
  }
}
Return true;
}
-->
"/SCRIPT>
"!DOCTYPE HTML PUBLIC" -//W3C//DTD HTML 4.01 Transitional//EN "" http://www.w3.org/TR/html4/loose.dtd ""
"HTML>
"HEAD>
"Meta HTTP-EQUIV=" Content-Type "CONTENT=" text/html; charset=gb2312 ""
"TITLE> lost its focus in time to verify the Form" /TITLE>
"/HEAD>

"BODY>
"FORM NAME=" form1 "METHOD=" post "ACTION=" ""
"INPUT TYPE=" government "NAME=" test1 "VALUETYPE=" string "OBJNAME=" name1 "MUSTINPUT=" true "STRINGLEN=" 10 "onBlur=" Javascript : checkString (), ""
"INPUT TYPE=" government "NAME=" test2 "VALUETYPE=" string "OBJNAME=" name2 "MUSTINPUT=" true "STRINGLEN=" 10 "onBlur=" checkString (), ""
"INPUT TYPE=" government "NAME=" test3 "VALUETYPE=" string "OBJNAME=" name3 "MUSTINPUT=" true "STRINGLEN=" 10 "onBlur=" checkString (), ""
"/FORM>
"/BODY>
"/HTML>

Strange belief
[code] Cited with a code in this forum, can not show a long sentence!
?????????????????????
China faces is how the code's going on? I did not increase icon, is a special character code?
????????????????


Use code, see smiling faces. Long sentences can not fully revealed.
[code]
"SCRIPT LANGUAGE=" Javascript "TYPE=" TEXT/JAVASCRIPT ""
<!--
/*** Inspection string ***/
Function checkString ()
{
Var ele=event.srcElement;
If (ele.valueType!=null)
{
If (ele.mustInput== ele.mustInput!=null, named "true"
{
If (trim (ele.value) ====== ""
{
If (ele.objName!=null)
{
Alert (ele.objName+ "not empty";
}
Else
{
Alert ( "Field of the text box bound to lose."
}
Ele.focus ();
Return false;
}
}
If (ele.stringLen!=null, named !isNaN (ele.stringLen))
{
Var value=new String (ele.value);
If (value.length>parseInt (ele.stringLen))
{
Alert ( "You imported" +convertNullToSpace (ele.objName) + "The maximum length of the" +ele.stringLen);
Ele.focus ();
Return false;
}
}
}
Return true;
}
-->
"/SCRIPT>
"!DOCTYPE HTML PUBLIC" -//W3C//DTD HTML 4.01 Transitional//EN "" http://www.w3.org/TR/html4/loose.dtd ""
"HTML>
"HEAD>
"Meta HTTP-EQUIV=" Content-Type "CONTENT=" text/html; charset=gb2312 ""
"TITLE> lost its focus in time to verify the Form" /TITLE>
"/HEAD>

"BODY>
"FORM NAME=" form1 "METHOD=" post "ACTION=" ""
"INPUT TYPE=" government "NAME=" test1 "VALUETYPE=" string "OBJNAME=" name1 "MUSTINPUT=" true "STRINGLEN=" 10 "onBlur=" Javascript : checkString (), ""
"INPUT TYPE=" government "NAME=" test2 "VALUETYPE=" string "OBJNAME=" name2 "MUSTINPUT=" true "STRINGLEN=" 10 "onBlur=" checkString (), ""
"INPUT TYPE=" government "NAME=" test3 "VALUETYPE=" string "OBJNAME=" name3 "MUSTINPUT=" true "STRINGLEN=" 10 "onBlur=" checkString (), ""
"/FORM>
"/BODY>
"/HTML>

[/code]

Please illustrated doubts !!!!!!!!
Please enlighten master!
Asks a friend to help!

I understand it is not enough for the event. Document.onclick = foo; removed, it becomes "input type=text name=field_1 onBlur=" foo "," failure. Please experts advise.

"Form name=form1>
"Input type=text name=field_1>
"/form>
"Script>
Function foo ()
{
If (event.srcElement.name)
        {
Alert (event.srcElement.name);
        }
}

Document.onclick = foo;

"/script>

There are many experts, please help me with it. Time, and not a single person can return?

People here really cold? Unfortunately !!!!! illustrated to do?

"Form name=form1>
"Input type=text name=field_1>
"/form>
"Script>
Function foo ()
{
Alert (event.srcElement);
}

Document.onclick = foo;

"/script>

You do not know success!
Document did not name ah

Thank you, a friend upstairs.
I did not say it clearly. Source code, but I have not changed after the links. So ask!
What I mean is : If I understand correctly, then the event. Changed later to pass. Unable to find a vent for a long time
Explanation.

Js have trim?

Counterm said in a message

Thank you, I see go up in smoke.




 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com