I have two prompt dialogue boxes that ask the user the enter their name and their employee number.I am experiencing two errors. The first is, if a user enters their name incorrectly, using numbers for example, there is an error message that asks the user to re-enter their name using a string. If the user ignores the error message and enters a number a second time, the program accepts the entry, which it shouldn't.
The second error has to do with the employee number prompt. The prompt asks the user to enter an employee number that is equal to 6 digits, the program however accepts any number, less than or greater than 6 digits, which it shouldn't.I don't want the user to get away with entering anything incorrectly.
<script type="text/javascript">
// prompt the employer the enter the employee name and number
var employName = prompt ("Please enter the employees' name" , " ");[code].....
I'm trying to have a user input a number in a prompt box which gets totaled and displayed in an alert box.This is what I have and its not working out for me.
I am using alot of Select boxes on one of my PHP/XHTML pages and i need to ensure the user has selected at least one option from the box.I have little experience with Javascript, but I tried this;
function madeSelection(elem, helperMsg) { if(elem.nodeValue == null)[code].....
All that is happening is its returning a boolean false regardless of whether or not i select an option.
[code]I have created an array of cars so if personA has more cars, they can click add and select another one. If they have 1 car and just enter name and 1 car, the form works but when I click Add row and select another car, it doesnt work?
I need to check that a user's birthday has been filled out completely, using drop down menus. I can validate each of the menus individually (see code below), but what i really want to do is make one check that all three are selected so that I don't have 3 extra error labels.
I have multiple checkboxes. How can I validate the group of check boxes so that a user can only select two. If they try to select more than two, an alert will pop up stating they can only choose two?
I am playing about with javascript arrays.Have recently just sat today looking through w3c and going through pages in a w3c book i bought on javascript and ajex.if im wanting to display stuff to use a drop down box but i need to learn to use arrays as the course im studying in college is on javascript and i feel this would be beneficial for me personally to know.i want to know if its possible to as well as select data from the array but also to Input new data from a button that opens a prompt box for users to enter a new array object.
Code JavaScript: <SCRIPT language="JavaScript"> <!-- function p_Names()[code].....
I'm trying to pass data I gathered from a prompt into a later function.
1. Should prompts for information be in their own JS file separate from the HTML page? Or is it better form to have the prompts (for info) in the HTML page itself?
2. I have tried placing the prompts to gather info in several places, each time my script seems to stop after the data is gathered and does not perform the calculations which are contained within a function. The input data is gathered from a prompt, do I still need to "return valuea" and "return valueb" in order to use the input data in the calculation function? Initially I did not feel I did, as I am not performing a calculation initially, just receiving input.
I should warn, i know almost nothing about javascript. i've been trying read sample scripts and examples on how to modify this script; but I just don't know enough. I have a script that pulls data from an array, and copies it directly to the clipboard when a user clicks on it. The problem is this only works in IE, because Firefox doesn't by default allow that to happen. I'm trying to change it so that when it is clicked, instead, it takes what was going to be copied to the clipboard, and puts it in a Prompt box for the user to copy and paste. I had other scripts that do that, but I can't for the life of me figure out how to learn from it!
iam trying to do a form with some validation on it and when the user enter an invalid entry the validation alert the invalid message and every thing works fine the problem is : after hitting okay button all the previous data entered in the fields is no longer exist so the user enter every thing again how do i keep he valid entry for the user in the fields
You will see that I have three combo box objects on this form - one containing dates (Date) and the other two containing times (Time1 & Time2). Each time on each date is an available appointment.
I would like the content of the date combos to be read from a file whenever the page is opened - a text file with one record per row would be fine (by way of an example - but this may be insufficient). On the face of it this would seem fairly rudimentary but I don't code in JavaScript of PHP and, having found this site I can make a start. I used to be a VB coder.
On each date the following appointment times are available: -
10:00 11:00 12:00 14:00 15:00
This assumes that no appointments on a given day are taken.This leads me to conclude that each date should have records for each time - possibly as a CSV text file as follows: -
"29th May 2009","10:00" "29th May 2009","11:00" "29th May 2009","12:00"
[code]...
The second time combo should make unavailable the time selected in the first time combo and present only those times available on the chosen date in the CSV file on the server.When I confirm appointments, at present I have to edit the page objects and update the web - which is quite messy and slow whereas uploading a simple text file, whilst an imperfect solution, is much better than what I currently have.
I believe that a PHP or Javascript routine based on events on the three objects would remove the inherent problems and would provide a useful set of building blocks for other routines of a similar nature.The routine would trigger whenever the page is loaded (or refreshed) or the content of any one of the three objects gets or loses the focus or a selection is made in an object.
The Date Combo would need to look up the available dates - keeping the currently selected date selected or, if that date is no longer available defaulting to the first date in the list. The user then makes a selection or makes no change to the selected date.The Time1 Combo then reads the available times for that date, retains the currently selected time (if available) or the first available time (if the selected is not available) and the user makes a selection or accepts the current selection.The Time2 Combo does the same as the Time1 Combo and in addition it eliminates the time selected in the Time1 Combo from the available choices.
The result is that visitors are only offered available times on available dates (insofar as this solution provides).When the form is submitted I would receive the email and confirm the appointment with the client and, in addition, I would modify and upload the modified data file to the web server using Filezilla. The benefit is that there is a slim to none chance of two people wanting to book the same times on the same date at exactly the same time (though it is possible). In addition, I can add new dates and add new times if there is a demand and I can even add previously deleted times if there is sufficient demand to warrant bringing in a second consultant to take the meetings.
I am using a validating form plug in for jquery and I have a question about it. Let this function will be an ex.:
[Code]....
'e' is the name attribute of one form element, but can I choose more elements using jquery (CSS) rules like this: input[name*=e] or how can I do something similar?
My aim: To click on a link (or what looks like a link to the user), and rather than the file linked to opening in the browser or what ever, the save dialogue comes up so they can download it instead.
I would like this to work with images - "click on the thumbnail to download a larger picture" - kind of thing. JPGs specifically.
Can anyone help? I'm sure it's possible in java script, I just can't find it anywhere. I've found a few ASP scraps but nothing concrete.
I want to show a process dialogue to the client till my process completes on the server. As long as my process dialogue appears, client should not be able to edit the page (or page become inactive); How to do this?
I would like to present the user with a confirmation dialogue box when they click the delete button on my webpage The button is not part of a form but instead is a buttton graphic with the following code:
Code: <td><a href='viewMyListings.php?cmd=delete&listingType=1&accommodationId=$accommodationId' title='Edit listing'><img src='../images/adminDeleteListingBtn.gif' alt='Delete listing'></a></td> Can anyone show me how this can be done? I am assuming javascript is the best solution for this?
I have a webform that creates a word document as it's ouput (yes I know it only works on IE). function createWordDoc(){ Doctxt = "some text here" var w=new ActiveXObject("Word.Application"); w.Visible=true; w.Documents.Add(); w.Selection.Font.Name="Times New Roman"; w.Selection.ParagraphFormat.Alignment = 1; w.Selection.TypeText(Doctxt); w.Documents.Save(); }
My issue is with saving the file. At the moment, in the above code, it opens the save dialogue box, and populates the filename field with the first line of text in the document. What I want to be able to do is populate the filename field with a variable filename created by the function. I've tried the snippet below, which works with the dynamic filename, but it autosaves the file to "My Documents" folder without prompting. I need to be able to allow the location to be changed. var FileName = "Myfile.doc" w.ActiveDocument.SaveAs(FileName);
Ive got codes that calculate the route & prices between distances upon entering data into two boxes lablled "to" and "from" using google maps. What I need is the route to be shown on the map. Ive tried the googlemap forums but they wont help me (they just direct me to the documentation which I dont really understand).
Anyway after trying to read and understand the code, I managed to get the map to display but when using the form to find postcodes, it stops working.
Im working on a backend panel where i populate a simple table with a few text boxes in there so they can update some values. I also have at the end of every row in the table an Edit, Delete & Save button. When i hit the save button i would like to update that entry in the database.
My Problem is that i need a value from the table before hitting a submit button, and the element names are dynamically created meaning ill likely need a variable sent from php to javascript and once i have the value in javascript ill need to send it back over to the php to manipulate and send to the server.
From wat i can gather using 'document.form.element.value' is the best way to go, hence why i posted this in javascript when most of my code is php.
Way back in the day I did some old school HTML....but after many years not touching a web page I've kind of been thrown straight into the fire with some "wish list" items I'm trying to figure out. I've done plenty of searches and somewhat have an understanding of some of the basics of what I need to do...but I'm not the least bit comfortable with Javascript (I'm just assuming that this the language most applicable to what I'm looking for - and after the experience of my one day crash course with PHP I knew I needed to turn to some experts.
Okay I have a rather large web (about 150 pages) of historical transcriptions created with XHTML (with PHP headers and footers embedded). Generally speaking, I don't much like web pages that have right-click disabled and various other protections in place.....but I'm also the sort to obsessively cite my source material and give proper credits....as a researcher who's hard work has been plagiarized and passed off as the fruits of someone else's labor, I wholly understand why many are inclined to put such walls up.
I have four html form check boxes.The user is allow to choose one or three of the check boxes, the last check box has a value of None.
Example: What's your favorite color.1. Red 2.Blue 3. Green 4. Gray. 5. None.The user can select more then one color.So I'm wondering how can I make the other check boxes deselect when the user click None.So if the user select None, then the other boxes cannot be checked. know you can do this with radio buttons but I would like the user to select more then one option.