JavaScript - Order Entry Questions
I have a script that needs extra variables added, but need some help on how to do it. I need a textbox to add shipping charges, and also a text box to add sales tax. Then these 2 amounts need to be added to the grand total. Any help appreciated.
The link below is to the page that has the form and code: http://spectrum-enterprise.com/sm/smorder.html Similar TutorialsI'm writing a report for my college class about what it takes to get into the field of computer programming and i need to obtain information from someone who is in the position of hiring entry level computer programmers. it would Really! help me out if someone has time to fill out these questions. I know its asking for a lot but if anyone has the time it would be highly appreciated! 1. Tell me a little bit about the company? ( Main focus, how did it start, who are your customers, company growth,etc) 2. Where do you see the industry in 5 years? 3. What makes the company successful? 4. What are you looking for in a potential candidate? 5. When interviewing a potential employee, what questions do you expect them to ask you? 6. How could a typical day on the job be described? How much variety is there on a day-to-day basis? 7. When you look at resume, what is your main focus in terms of order and importance, reference? 8. How do you feel about networking as a tool to research potential candidates? (ex. LinkedIN, Facebook?) 9. What education, experience and qualifications are need to enter the field as entry level position? 10. What is the salary range and job responsibilities? 11. What is best liked and least liked about this field / job? 12. What is a typical interview in this field? How is it different then regular interviews? 13. Is there a demand for people in this field? 14. What special advice could you give a person entering the field? 15. What types of training do companies offer persons entering this field? 16. Which professional journals and organizations would help me learn more about this field? 17. How can a new graduate obtain experience in the field? How and where can one get internship? 18. What types of technologies and software is used in the field? 19. Would you have any more information that will be of use to me? 20. Can you suggest others who may be valuable sources of information? Hello fellow programmers. I am currently in a JS class and have become stomped on part of the assignment. If anyone can provide guidance on how to format these order form functions, I will be much appreciative. 1. Within the <script> tags at the top of the file, create a function named "loadform()" that displays the current date in the formdate field and then moves the cursor focus to the qtyl field and selects it. Hint: Apply both the focus() and select() methods to the qtyl input box, and run the loadform() function when the page is loaded by the browser. 2. Below the loadform() function, insert a function named total_price that calculates the sum of the numeric values of the sub1 through sub8 fields. 3. Below the total_price function, create a function named tax_price() that adds the values of the sub1 through sub6 fields and then multiples that total by 0.05. Use the dollars() function to display this value rounded to two decimal places. Attached is a word doc of the program so not to blow this thread up. I should be able to complete the rest of the assignment once I have an understanding about the formats. If anymore information is needed, please let me know. I'm making 2 sites and need a visitor who lands on the home page of either site to first be shown a page that shows a company introduction and 2 links at the bottom so they can choose which division of the site (which website) they want to go to. Does anyone know of any pre-made java or other code that would allow for this? So that a visitor doesn't get stuck in a cycle of being taken from one home page to the other and having the pop-up every time, I'm thinking it will likely need to write a cookie saying they've seen the pop up, then it won't appear again. Each site would then have to check for a cookie from either site. Does anyone have any ideas on how to make this work? I'm open to anything and have to have it done by friday Not sure where the best place to post this would be...but what would be the best way (if at all) to go about writing a program that would automate data entry (from an excel spreadsheet) into an online database. I've been doing them one by one for the past couple of weeks...only have about 10,000 left...any help would be much appreciated thanks I'm working on a data entry form for an application, and I'm stuck at what may end up being some bad code. I'm capturing data for two tables (custinfo and orderinfo) on one page. The top part of the data entry form collects data once for the transaction, kind of like an invoice captures customer details. The bottom part (the part I'm stuck on) captures order information line after line. So, for example: TopForm (custinfo) Customer name Customer address Customer city, state, zip Bottom form (orderinfo) Item description Item quantity Item price What I'm looking for is two things: 1) The ability to extend the bottom form line by line as the order grows. 2) The ability to remove liness (last in, first out) from the bottom form if the order needs to shrink. Hi, I am trying to make an entry confirmation form. This is going to be used as a disclaimer for my website. How can I make this to where it only shows on the main page and not every page a user goes to on my website? <script> var enter=confirm("examples insert text") if (!enter) window.location="http://www.google.com" </script> Now I cannot get this code working. At the moment it needs to just update the table with the message and the user id ($uid) but it will not, the status does not return as "200", which the IF statment checks. AJAX: Code: function sendMessage() { if (sendReq.readyState == 4 || sendReq.readyState == 0) { var url = "scripts/get_data.php?uid=<?=$uid?>"; sendReq.open("POST", url, true); sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); sendReq.onreadystatechange = sendReset; var param = 'message=' + document.getElementById('txt_message').value; param += '&chat=1'; sendReq.send(param); if (sendReq == 4 || sendReq == 200) { document.getElementById('txt_message').value = ''; } } } PHP Code: //Send message if (isset($_POST['message']) && $_POST['message'] != '') { //Variables $chat = mysql_real_escape_string($_GET['chat']); $message = mysql_real_escape_string($_GET['message']); $query = "INSERT INTO message (chat_id, post_uid, recipient_uid, message, post_time) VALUES (1, ".$sid.", 4, ".$message.", date)"; mysql_query($query); } And here is the form if you want to see it: Code: <form id="frmmain" name="frmmain" onsubmit=""> <input type="button" name="btn_get_message" value="Refresh Chat" onclick="getMessage()" /> <input type="button" name="btn_reset_chat" id="btn_reset_chat" value="Reset Chat" onclick="resetChat()" /> <br /> <input type="text" id="txt_message" name="txt_message" style="width: 447px; color:#000000;" /> <input type="button" name="btn_send_message" id="btn_send_message" value="Send" onclick="sendMessage()" /> </form> I am using an example of this kind of feature to reference to, and I don't understand how the param is being sent to the server, is it being added to the URL? URL before param: scripts/get_data.php?uid=3 after param has been sent (changes in dark orange): scripts/get_data.php?uid=3 message=message goes here&chat=1 If so then I am guessing that the var param should look like this(change in red): Code: var param = ' & message=' + document.getElementById('txt_message').value; param += '&chat=1'; sendReq.send(param); <script language="javascript"> function splitNumber() {alert("inside splitnumber"); var x = parseInt(document.getElementById("value1").value); var z = x%10; /*units*/ var y = (x - z)/10; /*tens*/ var c = parseInt(document.getElementById("value3").value); var a = c%10; /*units*/ var b = (c - a)/10; /*tens*/ for(var i=0;i<=z;i++) { var parseInt(document.getElementById("u1").td.value); for(((document.getElementById("u1").td.value))=0;((document.getElementById("u1").td.value))<=i;((doc ument.getElementById("u1").td.value))++) { document.write("<td> " +document.getElementById("u1").td.value +"</td>") } } } </script> /*this is the code i write for generating unique values in the table cells, but it is not working*/ <body > <div class="left"> <table class="main" cellpadding="3px" cellspacing="6px"> <tr> <td width="630px" height="50px" bgcolor="#ffffff"> <table class="tens"> <tr id="t1"> <td value="9"></td> <td value="8"></td> <td value="7"></td> <td value="6"></td> <td value="5"></td> <td value="4"></td> <td value="3"></td> <td value="2"></td> <td value="1"></td> </tr> </table> </td> <td width="200px" height="50px" bgcolor="#ffffff"> <table class="units"> <tr id="u1"> <td value="9"></td> <td value="8"></td> <td value="7"></td> <td value="6"></td> <td value="5"></td> <td value="4"></td> <td value="3"></td> <td value="2"></td> <td value="1"></td> </tr> </table> </td> </tr> <tr> <td width="630px" height="50px" bgcolor="#ffffff"> <table class="tens"> <tr id="t2"> <td value="9"></td> <td value="8"></td> <td value="7"></td> <td value="6"></td> <td value="5"></td> <td value="4"></td> <td value="3"></td> <td value="2"></td> <td value="1"></td> </tr> </table> </td> <td width="200px" height="50px" bgcolor="#ffffff"> <table class="units"> <tr id="u2"> <td value="9"></td> <td value="8"></td> <td value="7"></td> <td value="6"></td> <td value="5"></td> <td value="4"></td> <td value="3"></td> <td value="2"></td> <td value="1"></td> </tr> </table> </td> </tr> <tr> <td width="630px" height="50px" bgcolor="#ffffff"> <table class="tens"> <tr id="t3"> <td value="9">9</td> <td value="8">8</td> <td value="7">7</td> <td value="6">6</td> <td value="5">5</td> <td value="4">4</td> <td value="3">3</td> <td value="2">2</td> <td value="1">1</td> </tr> </table> </td> <td width="200px" height="50px" bgcolor="#ffffff"> <table class="units"> <tr id="u3"> <td value="9">9</td> <td value="8">8</td> <td value="7">7</td> <td value="6">6</td> <td value="5">5</td> <td value="4">4</td> <td value="3">3</td> <td value="2">2</td> <td value="1">1</td> </tr> </table> </td> </tr> </table> </div> <div class="right" > <table cellpadding="3px"> <tr> <td width="5px"></td> <td><span class="row"><input min="0" max="99" type="number" id="value1" name="value1" value="0" onchange="javascript:addNumbers()"/></span></td> </tr> <tr> <td width="5px"><b style="font-size:25px; position:relative; top:18px;">+</b></td> <td><span class="row"><input min="0" max="99" type="number" id="value3" name="value3" value="0" onchange="javascript:addNumbers()"/></span></td></tr> <tr><td width="5px"></td> <td><span class="row" ><input style=" width:66px; position:relative; right:25px;" readonly="readonly" id="answer" name="answer" value="0" /></span></td></tr> </table> </div> </body> I have auto cursor focus event to be triggered when data is entered in a field.The issue is in the table when the cursor focuses to next field, that field doesnt come into view. the user can not see what he is entering in the field. This problem is for IE7, this wrks fine on mozilla. the horizontal bar scrolls automatically in mozilla but not in IE7, hence causing the problem. Please help me resolving this. I'm a fairly new ColdFusion developer and a true Javascript newbie, so gentleness please! I have a CF application that accepts two dates. The first date - Out Date - is required. The second date - Return Date - is optional, but if populated, must be equal to or greater than the Out Date. Here's the screen & code: <script type="text/javascript"> function compareDate() { if(document.editleave.temp_ret_date.value != "01/01/0001") if(document.editleave.temp_ret_date.value < document.editleave.temp_out_date.value) alert("Scheduled Through Date cannot be earlier than the Scheduled Out Date!"); setFormFocus(document.editleave.temp_ret_date); } </script> <cfinput type="datefield" name="temp_out_date" id="temp_out_date" value="#DateFormat(Now(), 'mm/dd/yyyy')#" validate="date" ValidateAt="onBlur,onSubmit" message="Please enter a valid date in MM/DD/CCYY format." size="6" maxlength="10"> <cfinput type="datefield" name="temp_ret_date" id="temp_ret_date" value="01/01/0001" ValidateAt="onBlur,onSubmit" message="Please enter a valid date in MM/DD/CCYY format." onBlur="compareDate();" size="6" maxlength="10"> Everything works fine....EXCEPT...if the Return Date is invalid, I cannot click on the calendar box to select a date (or open another browser session). Basically, IE is locked up until the user manually types in a valid date. This ain't good. I want to be able to trap the error, just like I have, but I still want the calendar selection box to be usable. Is it possible to "reset" the error condition after the intial warning to only trigger on the onSubmit parameter? I created an array, whose entries looks like this: [41, "The bird flew into it's cage"] [33, "He drew fire from Joe"] [33, "Roger asked her her name"] [2, "I am awfully happy"] . I want to pull the sentence item out of some array entries. E.g., in the second entry, namely, arrayName[1], what I thought was the second item (the sentence), I could manage by invoking arrayName[1][1] . But to my dismay, this doesn't do the trick. arrayName[1][1] actually delivers up the second CHARACTER of the entry (the number "3"). I thought the comma between the number and the sentence would separate the items, although I "pushed" each entry into the array as one single entry. How do I "grab" the whole sentence? How do I push both items separately to achieve "one entry"? Hi Guys, I am trying to make a function that will search for a substring, in this case 'http://instagr.am/p/' within a text area on a form then add '[embed]' & '[/embed]' tags around it. I have currently got the following code Code: <script type='text/javascript'> function show_alert() { str = formname.elements['inputid'].value; arr = (str.split(' ') + '<br />'); jQuery.each(arr, function() { if (arr.indexOf('http://instagr.am/p/') >= 0) { alert('An http://instagr.am/p/ link has been found'); //alert('It is entry ... in the array'); //Then edit the entry } } ); } </script> This breaks the contents of the textarea (at spaces) into an array then finds any entries with 'http://instagr.am/p/' in them (could be 'http://instagr.am/p/29fdghHdv'). Once it has found any and all of these entries it will add an '[embed]' code to the beginning and an '[/embed]' tag at the end. Example... http://instagr.am/p/vuHdeyfa2 is converted to: '[embed]http://instagr.am/p/vuHdeyfa2[/embed]' Then the changes must reflected in the textarea input "formname.elements["textareaid"].value = editedstring; Thankyou for your assistance. I have an options list that is generated from a database. It currently has ~125 options in it. I've received the request that the user be able to either enter the corresponding number or select the option from the list. How can I update the "selected" attribute in the options list based on a number that may be entered in another text entry box? Having trouble figuring out how to do this...I can get the particular entry by name but I can't randomly select one from the several because it's a string and not a number.... Code: var newOre = 0; var ore = { "iron" : 5, "silver" : 3, "gold" : 2, "platinum" : 1 } var userOre = { "iron" : 0, "silver" : 0, "gold" : 0, "platinum" : 0 } Code: function getAnotherOre () { newOre = ore[Math.floor(Math.random() * ore.length)]; userOre += newOre; } The random() is for an array, tried to use it here and returns 0 every time because the key in the key:value pair is a "string", though if I'm reading it right, it is trying to get a random number based off the length of the table, so why doesn't it do that? Ideally I want it to increment a corresponding hash table of users Ores...so if you randomly get a iron, it adds 5 to the users "iron" entry. I had a for loop, but I only need to randomly generate 1 entry result each time called so do I need to loop through things or can I just randomly get a key:value pair back and append that to the userOre table??????? AM I APPROACHING THIS WRONG FOR WHAT I WANT TO DO? Any ideas or link to documentation? I'm searching..... I can get the individual value of a field manually: console.log("keyName"); which will output the right number, but how do I get a random("keyName") and once I figure that out I probably would append("correspondingName", value) to the other table... Basically, functionally I just want to randomly get one of several values when the function is called. I guess I could make global variables for each type of ore, then just manually increment a random one some other way... This is for a html5 game where when you collide with a "mine" it triggers the function but I want it to randomly give various types of ore instead...Maybe I'm going about it wrong... Maybe it's easier just to declare 10 different global variables (assuming 10 ore types) and randomly give a number 0-10 of each every time the function is called......? I wish to have my form update a text field when a 'add' link or button is clicked, allow for more entries to be added without having the page refresh. but i need to be able to have both the friends name and their number added to the field like so if friends name is say 'jason' and their number is '0987654321' then it will add to the textarea like so. jason [0987654321] this way i should be able to get the data and split it up when the form is send so i can add them in the DB. the part i am stuck on is how to get both fields in the textarea. allowing for more to be added without a refresh. can anyone suggest how they might do this. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <form name="AddUser" action="" method="post"> <div> <div class="formspacer">Username: <input type="text" name="username" id="username" value=""></div> <div class="formspacer">Contact Telephone Number: <input type="text" name="phone" id="phone" value=""></div> <div class="formspacer">Your Email address: <input type="text" name="email" id="email" value=""></div> <br /> <div class="formspacer"><strong>Enter each entry and click ADD to insert.</strong></div> <div class="formspacer">Friend name: <input type="text" name="friendname" id="friendname" value="" size="40"></div> <div class="formspacer">Friend`s mobile: <input type="text" name="friendmob" id="friendmob" value="" size="20"> <br />ADD<br /> <textarea disabled name="MULTIfriend" id="MULTIfriend" cols=20 rows=10></textarea></div> </div> <input type="submit" name="AddUser" value="Add User"> </form> </body> </html> Anyone have any free code that will query a google calendar and then take the calendar entry and turn it into a message crawl?
I have created this form. I would like to use javascript to mail the form to the selected email from the selection list when the submit button is pressed. could anyone help with this? <form name="Contact Us" id="contact" action="mailto:" method="post"> <fieldset id="selection"> Who would you like to email: <select> <option value="email1" >email1</option> <option value="email2" >email2</option> <option value="email3">email3</option> </select> <fieldset id="Name" > Name <input type="text" id="firstname" name="firstname"> <input type="text" id="email" name="email"> </fieldset> <fieldset id="question"> Comments and Questions <input type="text" id="comment" name="comment" style="width: 500; height: 300"> </fieldset> </form> Hello folks! This is my first time posting here, and I am relatively new to JavaScript. I have come in need of assistance in guiding me in the right direction. My intentions are to create a web-based page where one can select from a few drop down menu's, and enter a few select pieces of information. This information would then be logged for later purposes, when the user chooses to retrieve this information (during the initial usage, no long term storage) in the format of a report. Would anyone have sources to similar coded applications, or any ideas of the directions I can go in for further assistance. I have at this point been utilizing the W3 website to learn. Thanks a ton! Dear all, attached is a page for my website to allow visitors to purchase photos. It is made from 2 Paypal example scripts - one for the form and another for an additional text box. It works fine apart from one detail, the text being entered does not get sent - instead, the information it forwards is "6x4 Colour Prints. Item Number id10" The "6x4 Colour prints" bit is good - the "Item number id10" is where I'd ideally like to see the custom text being entered and the guys at Paypal developer forums have said that a Javascript command is overriding the text being forwarded and to seek advice from those who know Javascript. I've tried for a day by trial and error to see if I can take this command out but it has got to the hair pulling out stage so I'm calling on those who know best to cast a wise eye over the code and see if there is an easy fix to this. Any help or suggestions as to howe to alter this will be most gratefully received. Thanks in advance, Dave. Hi, I'm wondering if someone can help me. I have recently used this tutorial: http://net.tutsplus.com/tutorials/ph...-confirmation/ to develop a more complex sign up form for a competition for a client. Basically, the way the validation has been done is different to many other validation methods I've used before and don't understand how to implement it, for some additional requirements. This is an example of the PHP validation code that I have altered, to suit my form requirements: Code: //quick/simple validation if(empty($code)){ $action['result'] = 'error'; array_push($text,'You forgot to enter your entry code'); } if(empty($name)){ $action['result'] = 'error'; array_push($text,'You forgot to enter your name'); } if(empty($email)){ $action['result'] = 'error'; array_push($text,'You forgot to enter your email address'); } This code only validates that there is content in those fields. But, for example on the 'entry code' field, I would like to put a maximum character input there and restrict certain characters, as well as a standard 'email' validation, so that the form is sent through to the database correctly. If anyone knows how I can do this, with this sign-up form in particular, please assist me, as every other method I've tried to work with this form hasn't worked and caused the form to error. Thank you in advance. |