Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

help for convert TEXTARE to HTML or PHP code

Hi
I want to write a HTML or PHP code with For loop or if-else or ..., that User write a Word definition & see an answer.
I wrote this by TEXTAREA but I like the code can give special style for every answer!
<I want to user enter word like bottom example. not at a form and press submit button>


at this code you see an answer if write camera, gallery, or another undefined word :

<textarea onkeydown="cmd.check();" onkeypress="cmd.check();" onkeyup="cmd.check();" id="code_THIS"></textarea>
<style>#code_THIS{background:#FFF;border:0px #333 solid;color:#000;font-size:20px;font-family:"Yekan", Courier, monospace;direction:ltr;text-align:left;padding:2px;min-height:100%;width:100%;border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-webkit-border-radius:3px;-khtm-border-radius:3px;}</style>
<div style="position:absolute;top:-200%;"></div>
<script>cmd={question:,answer:,doScript:[,],TypeChar:'> ',error:'nothing found!',id:document.getElementById('code_THIS'),numCharMoisrex:-1,startAll:function(){this.id.focus();this.id.value=this.TypeChar;},check:function(){if(new RegExp(this.value,'g').test(this.id.value)==false)this.startAll();Q=this.id.value.substring(this.id.value.lastIndexOf(this.TypeChar)+this.TypeChar.length,this.id.value.length);d=0;if(newthis.TypeChar,).test(this.id.value.substring(this.id.value.lastIndexOf('\n\n 0,this.id.value.length))==true){for(i=0;i<this.question.length;i++){if(newgExp(unescape(this.question)+'\n','i').test(Q)==true){this.id.value+=unescape(this.answer);var doscript=unescape(this.doScript);eval(doscript);this.id.value+='\n\n'+this.TypeChar;d=1;}}if(new'help\n',).test(Q)==true && d==0){for(i=0;i<this.question.length;i++)this.id.value+=unescape(this.question)+'\n';this.id.value+='\nThisigned By Sir\n\n'+this.TypeChar;}else if(new RegExp('\n','').test(Q)==true && d==0){this.id.value+=this.error+'\n\n'+this.TypeChar;}}elsethis.idthis.id.value+='\n\n'+this.TypeChar;},about:'Designedd.startAll();</script>

thanks if help me...

Comments

  • I'm not quite sure what you mean... Do you want a prompt where the player can enter text? In harlowe, sugarcane or snowman?
Sign In or Register to comment.