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..

View 1 Replies


ADVERTISEMENT

Dynamically Fill And Format A Texfield Box Based On 2 Other Filled Texfield Boxes

Jul 20, 2005

I have 3 texfield boxes

1. firstname
2. lastname
3. username

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?

View 2 Replies View Related

If To Check If Field Filled

Nov 12, 2003

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

if(variable = ""){
bla bla bla ..............
}

doesnt work,

View 2 Replies View Related

JS To Add New <input> Field When Last One Is Filled In

May 5, 2006

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)

<input type='text' name='kit_parts[]' />

Thats the line it needs to add.

View 5 Replies View Related

How To Use A Field Value To Auto Fill Other Field Values

Sep 17, 2009

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

View 2 Replies View Related

Jquery :: Radio Button Auto-Fill Another Field

Jul 27, 2011

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.)

My PHP/HTML Code:
//Radio Button 1:
<input name="showtype" type="radio" id="showtype" value="basic" <?PHP print $basic_status; ?> onclick="fillShowTypeCost(this.form)"> Basic Slideshow

//Radio Button 2:
<input name="showtype" type="radio" id="showtype" value="lovestory" <?PHP print $lovestory_status; ?> onclick="fillShowTypeCost(this.form)"> Love Story

//Text field to be auto-updated
<input name="showtype_cost" type="text" id="showtype_cost" value="<? echo $row_settings['showtype_cost']; ?>">

View 5 Replies View Related

Setup To Get Form Field Filled Automatically

Mar 4, 2009

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");
}

View 4 Replies View Related

JQuery :: Autocomplete - Using Select Event To Fill Hidden Field

Jul 15, 2010

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.

This is my code
$(function() {
$('input#<%= tblNewInsert.FindControl("nazioni").ClientID %>').autocomplete({
source: function(request, response) {
$.ajax({
url: "offerte.aspx/fillJson",
data: "{ 'descrizione': '" + request.term + "', 'tabella': 'nazioni', 'campo': 'paese' }",
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
select: function(event, ui) { alert("never fired"},
success: function(data) {
response($.map(data.d, function(item) {
return {
value: item.descrizione
}}))},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert(textStatus);
}});},
minLength: 1
});});

View 1 Replies View Related

Opposite Of Undefined When Checking If A Form Field Is Filled Or Not?

Dec 13, 2011

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.

View 3 Replies View Related

JQuery :: Validate - Validation Plugin - How Not Validate Field Already Filled

Aug 20, 2010

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.

View 1 Replies View Related

Fill Two Fields From One Select Field?

Jun 24, 2011

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.

View 11 Replies View Related

Using Popup To Fill Input Field

Apr 14, 2008

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 ...

View 3 Replies View Related

Auto Fill Text Field

Jul 21, 2003

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:

View 2 Replies View Related

Fill Field, If Checkbox Checked?

Aug 9, 2010

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)

Code:
<input type="text" name="email" value="">
<input type="checkbox" name="Inform" value="Tell me stuff">

[code]....

View 5 Replies View Related

Pre-fill Automatically A Form Field With Part Of The URL

Aug 1, 2009

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.

View 2 Replies View Related

Grab A Value Off Of A URL And Fill In A Input Field On The Page With That Value?

Feb 1, 2010

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 ?

View 3 Replies View Related

Fill Value Of Text Field Based On Dropdown?

Sep 25, 2010

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.

View 1 Replies View Related

ExtJS: Fill A Field Form With A Grid

Jul 18, 2011

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:

[Code]...

View 4 Replies View Related

Pre-fill Automatically A Form Field With Part Of The URL - Site With Dreamweaver CS3

Aug 2, 2009

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.

View 4 Replies View Related

Clickable Calendar - Xin's Popup - Dates To Fill The Month Select Field

Mar 3, 2009

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.

View 1 Replies View Related

Hiding A Heading - Hide A Title / Heading If A Field Below Is Not Filled In

Jan 17, 2011

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?

View 3 Replies View Related

Disallow A Certain Character In A Form?

Sep 24, 2010

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.

View 2 Replies View Related

Code To Disallow Changing Values?

Jun 9, 2010

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 .

View 4 Replies View Related

Disallow Characters Like %$& In A File Name In An Upload Form

Aug 30, 2010

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 !@#$%^'&*()"?

how do i go on about this?

View 12 Replies View Related

Data Validation - Disallow Past Dates

Nov 1, 2011

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; .....

View 14 Replies View Related

Disallow Access To A Page If Javascript Is Disabled

Mar 31, 2005

I want to redirect my user to an alternate page if javascript is disallowed on their browser. Is there a way to do this ?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved