JQuery :: Disallow To Fill Field When Another Already Filled?
Dec 30, 2011
I'm have a Joomla component who use Jquery for several thing in his template. This component have a form where some field are displayed and I would like conditionnaly restrict the use of 2 fields. I have in fact a field "City" and a field "Zip code" and my goal is to disable one field if the other is filled. In practice that mean if a user start to type the name of a city, the zip field must be disabled for avoid to fill also this field. Same thing if the user start to type in the zip field...the field City must be disabled too..
I need to setup this because the search engine of my component can not retreive correctly data if both field are filled. This happen tipically if the the zip code don't match with the name of the city... I that case the component will display "no result found" and this is annoying. Any example of working code making possible to get this function? Unfortunately I'm not a coder and except html and a bit of css, I do not have enough knowledge..
When a person enters in their firstname and lastname, I want the username field to fill with firstnameLastinitial.
Eg. Firstname = Adam, Lastname = Apple, Username = AdamA
I want to do it dynamically so as they're typing their firstname, it's filling in the username field. And when they fill in their lastname, it does it, but it would only have to do it for the first letter then go out of the loop.
I don't even know where to start on this one.. onChange is the event?
i have an if structure checking to see of the fields have been filled in. On the text fields though there is no value so how can i check to see if nothing there which would mean aint been filled in. i tried
What it needs to do is when the user fills in the last <input> it will add another one bellow it, and if it gets emptied it then removes the one bellow is (as long as it is empty too)
Not exactly sure this is the right forum to post this but just to give it a shot.I am relatively new to programmming...I am currently working on a web appliation using MySQL DB and use PHP/SQL.I have a web form i have created. What i want to achieve is that when a user fills in one of the fields...a text field, i want 8 other fields to be AUTO filled with different values related to the one the user filled in
I'm pretty new to coding. I have a form with two radio buttons to choose from. I would like a custom javascript function (fillShowTypeCost) to automatically update a text field with the correct amount of money, based on which radio button is selected. I originally had this form done with checkboxes and it worked just fine. Since I switched to radios, I am completely lost. I have tried using an array search to determine which value is selected, but I must be doing something wrong, because it isn't working. My codes are below. (The PHP end of things are working great.)
Basically, I've setup a form to have all the required data written to a csv file. Now, The only thing is some of the non-required fields are filled in and some people don't fill them in, so when I import it into excel, the fields move about. What I need to know, is there a condition I can set to have a value written into all the empty fields when it is submitted?
Here is where I am with that so far: if (app100.address2.value == "") { doc.write("N/A"); }
I'm using jquery autocomplete to fill a textbox with some text but I need to get the ID of the item too. For this purpose I thought to use the on select event to fill an hidden field the problem is that the on select event is never fired.
What I am wanting to do is have my form open up a new part of the form when the previous sections are filled out. i.e name field shows, when it has content, the next field opens up for it to be filled out, and so on.
I have a form (form1) to register with the fields: user, email, password being validated normally.
Have a second form (Form2) to the user update the data registered in form1, and the fields user, email, password is already populated with data from the database, the email field I use the remote validation, and as the field already has been completed and read always says that this email already exists, how do I create a rule or method so that when the field is already filled it not do so validating and validate if it is filled with a new email. Email2 have a hidden field in order to do a test type.
I have a PHP form which has an select field (i.e. drop-options) where the different options are populated from a MySQL database as follows:
<select size="1" id="category" name="category"> <option value="">Select from drop-list:</option> <?php $sql = "SELECT * FROM `DB1`
[code]....
Now, the issue I have is that I also have another input field (possibly hidden) in this form which is called 'category_id', and what I want it to do is to automatically populate when the user selects the relevant 'category' from the select field above.
I am looking for a way to use minimal javascript to open a popup window when the user clicks on an input field and allow them to choose one string inside the pop up window (like click on a radio button) and get the input box in the parent window filled with the value of the string. I know it's kinda standard, but I don't know much about using javascript ... so I dont know exactly what to search for ... I've seen hotmail allows you to populate your recipient input box using a popup ... I am looking to do something similar ...
I have an HTC (Thanks to Beetle) that auto fills a field as a user key strokes letters into a text box. Except for one thing everything works great. The one thing is if a use types somethin in that is found, accepts it (tabs out of the field) the goes back to the first letter and trys to change the case (upper to lower or vise versa) it gets an error "invalid argument". I cannot seem to figure out why it would error. Below I have all of the code HTML and HTC should be easy Code:
I have a form which has a checkbox option.Only - if the checkbox is checked, then the email field must also be filled in.Otherwise the form is handled as normal (this includes filling in the email even if the checkbox is not checked).(hope this makes sense)
I am developing a site with Dreamweaver CS3 and have a little knowledge of HTML.
I need a solution for the following:
Visitors can come to my site through a referrer for ex: [url]
The referrers information (cesar017) should be prefilled automatically in a form field on another page than the index page. This means the visitor first can look around on the other pages of the site and then go to the page with the form.
I dont use a database at this moment, I only want a certain field automatically prefilled with the referrers info from the URL for ex : <input type= hidden -or text- name= partner id= partner value= ""/> In this case the field should have the value=cesar017
I understood this can be solved with Javascript or PHP and cookies, but I nearly dont know anything about this and Dreamweaver has not automated this function.
how can i grab a value off of a URL and fill in a input field on the page with that value? Say I have this url: [URL] how can i grab the value of var_email and pulse_daily and place it in a input field ?
What im trying to do is for each item selected from the drop down, display its value in a text box (GAC). I have attached a picture of the image to clarify.
The drop down items are populated from a database, and each item has an associated GAC value. The remaining inputs are user supplied and all the inputs including the drop down item and its value are is stored in a different table in the database.
I'm starting with javascript and I have a doubt. I already have a grid with data and a form with 5 fields. One of these fields of the form I want to fill with data of the grid. This is what I have:
I am developing a site with Dreamweaver CS3 and have a little knowledge of HTML.
I need a solution for the following:
Visitors can come to my site through a referrer for ex: [url]
The referrers information (cesar017) should be prefilled automatically in a form field on another page than the index page. This means the visitor first can look around on the other pages of the site and then go to the page with the form.
I dont use a database at this moment, I only want a certain field automatically prefilled with the referrers info from the URL for ex : <input type= hidden -or text- name= partner id= partner value= ""/> In this case the field should have the value=cesar017
I understood this can be solved with Javascript or PHP and cookies, but I nearly dont know anything about this and Dreamweaver has not automated this function.
I'm trying to get Xin's Popup Calendar -- [url]-- to work with the following form:
I need the dates to fill the month select field, the year select field, and the date text field but I cannot understand how to do this, I'm very new at javascript.
If I want to hide a title / heading if a field below is not filled in, what would be the js for that?
I have an "Attachments" h2 heading and three following fields for the client to add up to three attachments. But if none are filled in I want the h2 heading to not display.
This is what I have so far:
This should take care of the three fields, but how do I tie in the heading too?
Just wondering if anyone knew how to make it so that if someone types an apostrophe in a form's textbox, a popup box appears. The popup box would preferably appear the second that the apostrophe is entered int he form box and then once the popup box is closed, the apostrophe is deleted.
i want to disallow users to change a text input values . I don't want to use disabled tag of text input because of some problem . I just want to disallow users to enter or change a text input value .
i have a html/php form which let users upload pictures onto my server. the problem with it is, it says the picture has been uploaded but if the file name contains any of character apart from text (A-z) and numbers, the picture never shows up in the admin panel.
is there a way using ajax or jquery to disallow certain file names in the upload field of the html which uses these characters !@#$%^'&*()"?
I came up with this but it's not working and I'm not exactly sure why. <script type="text/javascript"> function date_check(){ var trans_date = document.form1.selectmonth.value + "-" + document.form1.selectday.value + "-" + document.form1.selectyear.value; var d = new Date(); var today = (d.getMonth()+1) + "-" + d.getDate() + "-" + d.getFullYear(); if(new Date(trans_date) < new Date(today)){ window.alert("The shipping date cannot be in the past, please enter a valid shipping date."); return false; .....