Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Web Based] Javascript List Generator

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Up2Admin
I'm a spammer
Reputation: 126

Joined: 17 Oct 2007
Posts: 6548
Location: Texas

PostPosted: Wed Aug 19, 2009 6:57 pm    Post subject: [Web Based] Javascript List Generator Reply with quote

This was just something I made out of boredom. It's pretty basic.

What's it do?
It generates a list based on an array. If you enter a value into the text-box, the value is pushed into the array and displayed in the list.

Code:

<style type="text/css">
ul#list{
   text-align:left;
   margin:0 auto;
   white-space: nowrap;
   cursor:default;
   border:1px;
   border-color:#000;
   border-style:solid;
}
#list li{
   padding-right:5px;
   padding-left:5px;
   padding-top:1px;
   display: inline;
   list-style-type: none;
   border-right:1px;
   border-right-color:#000;
   border-right-style:solid;
}
</style>
<div id="listContainer"></div>
<script type="text/javascript">
var randName = Array('Chris','Jon','Michael','Dave','Fez','Saun','Bill','Dale','Bobby','Cole','BingBong','kDone');
function addName(username,description,id){
   document.getElementById('listContainer').innerHTML+="<ul id=\"list\"><li>"+username+"</li><li>"+description+"</li><li>"+id+"</li></ul>";
   
}
function randItem(){
   document.getElementById('listContainer').innerHTML="";
   var i = Number(0);
   if(document.getElementById('listTXT').value!=""){
      randName.push(document.getElementById('listTXT').value);
   }
   while(i<randName.length){
      addName(randName[i],i,i+1);
      i++
   }
}
</script>
<br />
<button onClick="randItem()">Create list</button><input id="listTXT" type="text" />


Result

_________________
Back to top
View user's profile Send private message Visit poster's website
Polynomial
Grandmaster Cheater
Reputation: 5

Joined: 17 Feb 2008
Posts: 524
Location: Inside the Intel CET shadow stack

PostPosted: Thu Aug 20, 2009 3:54 am    Post subject: Reply with quote

Why not modify it to use the ListBox control instead of coding your own static HTML?

Code:
<select size="5">
<option value="1">John</option>
<option value="2">Chris</option>
... etc
</select>

_________________
It's not fun unless every exploit mitigation is enabled.
Please do not reply to my posts with LLM-generated slop; I consider it to be an insult to my time.
Back to top
View user's profile Send private message
Up2Admin
I'm a spammer
Reputation: 126

Joined: 17 Oct 2007
Posts: 6548
Location: Texas

PostPosted: Thu Aug 20, 2009 8:21 am    Post subject: Reply with quote

Burningmace wrote:
Why not modify it to use the ListBox control instead of coding your own static HTML?

Code:
<select size="5">
<option value="1">John</option>
<option value="2">Chris</option>
... etc
</select>
I've never heard of that, I'll check it out sometime. But from what I can see, it's less flexible.
_________________
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites