Greetings from Vienna

Joined
May 6, 2022
Messages
5
Reaction score
0
Guten Tag,
I have no idea about coding and i want to realise a little project.
Is somebody interrested in helping me?
cheers pauli
 
Joined
May 6, 2022
Messages
5
Reaction score
0
Hi guys,
I need a window that changes a number to letters. For example if you write 16 into a box I need the letters BB to appear in another box. The letters change depending on the numbers.
Then I need 2 more boxes that will be filled only with numbers. This 2 numbers have to go into the box where the BB will be.

For example
First box: 16
Second box: 2
Third box: 7

Fourth box: BB2&7

I hope this is understandable. I imagine this is not a hard thing to do for somebody who knows a bit about coding..
Thank you for your help and advice
Cheers Pauli
 
Joined
Mar 11, 2022
Messages
227
Reaction score
32
This should work
Code:
//HTML
<div><input id="box1" type="number" /></div>
<div><input id="box2" type="number" /></div>
<div><input id="box3" type="number" /></div>
<div id="output"></div>
//JAVASCRIPT
<script>
const box1=document.getElementById('box1'); const box2=document.getElementById('box2'); const box3=document.getElementById('box3'); const output=document.getElementById('output');
const listA=new Array(16,22,33);
const listB=new Array('BB','AA','DD');
var outputs='';
box1.onkeyup=box2.onkeyup=box3.onkeyup=box1.onchange=box2.onchange=box3.onchange=function(){    
outputs=box1.value.trim();
 for(var i=0; i<listA.length; i++){if(box1.value.trim()==listA[i]){outputs=listB[i];}}
 outputs+=box2.value.trim()+'&'+box3.value.trim();
 output.innerHTML=outputs;
}
</script>
 
Joined
May 6, 2022
Messages
5
Reaction score
0
This should work
Code:
//HTML
<div><input id="box1" type="number" /></div>
<div><input id="box2" type="number" /></div>
<div><input id="box3" type="number" /></div>
<div id="output"></div>
//JAVASCRIPT
<script>
const box1=document.getElementById('box1'); const box2=document.getElementById('box2'); const box3=document.getElementById('box3'); const output=document.getElementById('output');
const listA=new Array(16,22,33);
const listB=new Array('BB','AA','DD');
var outputs='';
box1.onkeyup=box2.onkeyup=box3.onkeyup=box1.onchange=box2.onchange=box3.onchange=function(){   
outputs=box1.value.trim();
 for(var i=0; i<listA.length; i++){if(box1.value.trim()==listA[i]){outputs=listB[i];}}
 outputs+=box2.value.trim()+'&'+box3.value.trim();
 output.innerHTML=outputs;
}
</script>
Vielen Dank für den Code. Mfg Pauli
 
Joined
Mar 11, 2022
Messages
227
Reaction score
32
Kein Problem. Das Design musst natürlich entsprechend anpassen. Lies dich dazu einfach in das Thema HTML und CSS ein. Ist alles nicht so schwer wie es sich zunächst liest :)

Eine Sache ist aber noch wichtig. Ich hab dir jetzt Code um die Ohren gehauen. Den solltest du aber dennoch für dein Projekt zumindest ansatzweise verstehen. Ist das so?
 
Joined
May 6, 2022
Messages
5
Reaction score
0
Hallo,
ehrlich gesagt ich kenn mich überhaupt nicht aus. Ich weiß genau ich brauch und theoretisch versteh ich programmieren schon aber es wirklich zu einem programm zu machen kann ich nicht. Aber ich schau mir mal HTML ein bisschen an und probiere es.
ist es für dich ok wenn wir per email weiterschreiben?
mfg Pauli
 
Joined
Mar 11, 2022
Messages
227
Reaction score
32
Keine Ahnung. Ich weiß nicht was die Forenregeln sind. Ich schreibe nie PN. Du wärst der erste. Naja, vielleicht kommt das noch. Kann sein, dass die eben Zeit brauchen, bis sie die PN Funktion für dich freischalten. Geduld :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Greetings 1
Greetings From the Other Side... 3
Hello from Bulgaria 0
Malicious Coding Help Please 5
About me... 0
Hello 0
Hello to community. 3
Hi From Canada 3

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top