0

Creating an interactive html form

Hello Sololearners, I want to create a html form that by calling a "Submit", it would print the entered values by the user, but by adding a specific syntax next to the entered values: What I would like to achieve by clicking submit is something like this: dsadd user "CN=testuser, OU=IT, DC=test, DC=local" -samid tuser -upn [email protected] -display "Firstname Lastname" -fn Firstname -ln Lastname -pwd [email protected] -tel 123456 -email [email protected] -pwdneverexpires yes -dept IT -desc IT where CN, OU, samid, display would be all part of the input form below. The initial HTML form would be something like this, I guess: <html> <body> <form action="C:\Users\localuser\welcome.php method="get"> <!--(or a file called via a script command on javascript? --> First Name: <input type="text"> Last Name <input type="text"> Username<input type="text" name = "samid" > Password<input type="password" name = "password" > E-mail: <input type="text" name="upn"><br> <input type="submit"> </form> </body> </html> etc... I'm not asking for a quick solution, but rather some explanation on where to start, understanding of the possibilities, etc. :) Then, this file would serve as a ready-to-use .bat file with multiple "testuser" lines ready to be executed in bulk. Meaning, the form, should output something like this: dsadd user "CN=testuser1, OU=IT, DC=test, DC=local" -samid tuser -upn [email protected] -display "Firstname Lastname" -fn Firstname -ln Lastname -pwd [email protected] -tel 123456 -email [email protected] -pwdneverexpires yes -dept IT -desc IT dsadd user "CN=testuser2, OU=IT, DC=test, DC=local" -samid tuser -upn [email protected] -display "Firstname Lastname" -fn Firstname -ln Lastname -pwd [email protected] -tel 123456 -email [email protected] -pwdneverexpires yes -dept IT -desc IT dsadd user "CN=testuser3, OU=IT, DC=test, DC=local" -samid tuser -upn [email protected] -display "Firstname Lastname" -fn Firstname -ln Lastname -pwd [email protected] -tel 123456

26th Jan 2020, 7:36 PM
Abdul
Abdul - avatar
7 Answers
+ 1
Provoje me document.getElementById("id_input").value Nqs nuk e ke provu tashme.
26th Jan 2020, 7:52 PM
Erialdo Meta 🇦🇱
Erialdo Meta 🇦🇱 - avatar
+ 1
Jo nuk ka nevoje per nderhyrje ne php. Thjesht javascript. Mjafton qe prefixet apo postfixet te jene te ruajtura ne variable te javascriptit qe me pas tja bashkangjitesh te dhenave nga useri. Pasi te mbarosh manipulimin e ketyre mund te ruash filen. Une thjesht pashe perciptazi ne internet dhe ndoshta kjo libraria mund te te ndihmoje https://github.com/eligrey/FileSaver.js
26th Jan 2020, 10:48 PM
Erialdo Meta 🇦🇱
Erialdo Meta 🇦🇱 - avatar
+ 1
Ky eshte skripti final . https://www.w3schools.com/code/tryit.asp?filename=GBBBWXFSFG6E Jo perfekt, por ben çfare me duhet. haha... Tani duhet te shoh ndonje tutorial per CSS. ;)
27th Jan 2020, 11:20 AM
Abdul
Abdul - avatar
0
Erialdo, flm! Sapo e provova... avansova pak, por psh ne kodin me poshte, cfare do qe te jete "input", vetem vlera e document.ElementId printohet si "output"... nderkohe qe me duhet edhe input i klientit bashke. :) Shih detajet : <!DOCTYPE html> <html> <body> Emri: <input type="text" id="myEmri"; value= ""> Mbiemri: <input type="text" id ="myMbiemri"; value=""> Emri i përdoruesit: <input type ="text" id= "myPerdoruesi"; value=""> UPN (E-mail): <input type="email" id="myEmail"; value="@test.local"> <p> Generate ready-to-copy .bat file </p> <button onclick="myFunction()"> Start</button> <script> function myFunction() { document.getElementById("myEmri").value = '-fn' + <!-- ketu me duhet edhe user input -- p.sh -fn Filan> document.getElementById("myMbiemri").value = '-ln' <!-- ketu me duhet edhe user input -- p.sh -ln Fisteku> document.getElementById("myPerdoruesi").value = '-samid' } </script> </body> </html> Sidomos, çfare eshte me e rendesishmja, eshte qe te dhenat finale duhet te me dalin si blllok "comma" (tip csv-je), e jo thjesht te shfaqen tek "fushat : Emri, Mbiemri, etj... Kam pershtypjen duhet pak nderyhrja e php.
26th Jan 2020, 8:43 PM
Abdul
Abdul - avatar
0
Shume faleminderit. Sonte e punova pak me gjate dhe do ta postoj ketu linkun e w3schools neser
26th Jan 2020, 10:55 PM
Abdul
Abdul - avatar
0
Te lumte a e zgjidhe?
27th Jan 2020, 11:31 AM
Erialdo Meta 🇦🇱
Erialdo Meta 🇦🇱 - avatar
0
Po, ngelet tani ta shoh, pse nuk i ekzekuton .bat komandat ne Win Server 2008 R2. :D . Rrofsh dhe njehere!
27th Jan 2020, 12:09 PM
Abdul
Abdul - avatar