1 Replies - 1032 Views - Last Post: 09 June 2013 - 07:34 AM Rate Topic: -----

#1 Supraman9291   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 07-June 13

Completing task with coding project!

Posted 07 June 2013 - 03:47 PM

Hello, I have a problem that is kind of advanced for me to do with the time frame I have.. I will need a little bit of assistance..Posted Image

Lets say...
-user pushes generate button to get a random unique id
-user inputs 3 into qty text box and pushes submit
-as a result of the submit button, it will use a window.print() command to print out the unique ids with the "-x" added to the end of the ids.
DDF41F1D95F7-1,DDF41F1D95F7-2,DDF41F1D95F7-3. The window.print() function will change according to the number inputted into the qty field. so if qty was 4 the window.print() will print out 4 sheets of paper. that has DDF41F1D95F7-1 on sheet 1, DDF41F1D95F7-2 on sheet 2,DDF41F1D95F7-3 on sheet 3, and DDF41F1D95F7-4 on the last sheet.
This is the code for the id generator. the textbox corresponding with the generator is called "generateidtxt"
//generates the randomness
function guidGenerator() {
    var S4 = function() {
       return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
    return (S4()+S4()+S4());
//displays unique id into the textbox
function generateID() {

		var TheTextBox = document.getElementById("generateidtxt");
TheTextBox.value = TheTextBox.value + guidGenerator().toString().toUpperCase();


this is the unique id that will be printed out.. the new code should sit before the report=""; and also the code under it should be tweaked. aka the window.print();

//new code goes here

        report = "";
        report += "ID: " + document.getElementById("generateidtxt").value + "<br>" 

The qty textboxname is "qtytxt"

If I can get some assistance with this code, I will be very appreciated. Thank you!

Is This A Good Question/Topic? 0
  • +

Replies To: Completing task with coding project!

#2 trevster344   User is offline

  • The Peasant
  • member icon

Reputation: 225
  • View blog
  • Posts: 1,526
  • Joined: 16-March 11

Re: Completing task with coding project!

Posted 09 June 2013 - 07:34 AM

What's your problem exactly? We don't hand out code here, and we don't just run through your code looking for all the problems we can find. That's your job. You have to tell us what the problem is as well as show us what you've tried specifically for the problem and task at hand.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1