Show Input If Value True
Apr 24, 2009i have a select tag that has values 0 -5 what i want is to show a input field if the value is more than 0 below
[Code]...
i have a select tag that has values 0 -5 what i want is to show a input field if the value is more than 0 below
[Code]...
Here my script :
<script>
$(document).ready(function(){
$('#test1_invalidation_comment__row').hide();
if($('#test1_invalidation_comment').val())
[Code].....
My script work each two submit can't figure why.
I just found out that clone(true) and my masked input plugin aren'tplaying nice together.Inside of my plugin I grab a reference to eachobject like this: "var input=$(this);" and then inside of my boundfunctions, I reference "input". After a clone(true) the events thatfire on the cloned input act on original input.Does anyone have any suggestions/guidelines for how I can make myplugin behave correctly with clone(true)
View 4 Replies View RelatedI have a welcome page, where there is a text field and submit button.The user types in their name and press submit which will open up a window to Page 1 and so on.
Now whenever it opens up pages, it will use the name that was inputted on the welcome page.
eg.
Page 1 = Hello, <inputted name>, how are you today.
Page 2 = So, <inputted name>, what are your plans for today?
Page 3 = <inputted name>, would you like to go to the movies?
I would like to hide a div when input type text is empty. And as soon as you start typing in the input type text field, a div below would appear.
View 1 Replies View RelatedI have this code:
PHP Code:
<script>
function checkForOther(obj)
[code]....
How to show error inside input box as I test jquery-plugin-validatorform-1.7.js.
How to show error under listox? [code]...
It shows an input field when the select value is "dropped". The problem I am having is that if I select "dropped" it will display the input field, but if i select a different value AFTER selecting "dropped" the input field is sill displaying. How would I get it to hide the input field if it is NOT selected?
<!--SHOW/HIDE DIV-->
<script type="text/javascript">
$(document).ready(function(){
$('#dropped').hide();
[Code].....
I've been trying to check what I did wrong in my code but still the total doesn't show. Below is my javascript function:
function CalculateTotal(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r)
{
var tota= document.getElementById('a');
[code].....
I'm showing in a field the name of the file the user has chosen. I would like to show the whole name as the title when passing the mouse over the field, in case the name is too long. I swear this was working, but it's not anymore (I'm testing with FF). I don't know how it was working, maybe I used a different combination of quotes or semicolons or I don't know. I can't make it work again. When you pass de mouse over the field it is showing the code instead of the innerHTML referenced:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
<head>
<script type="text/javascript">
[Code]...
I've been working on a project and in the form page, when the user types something and clicks on the send button, the data he typed in, does not show in the email client. The form is had validation.
Here is the code
<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 StrictEN"
"http:www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http:www.w3.org/1999/xhtml" xml:lang="nl" lang="nl">
[code]....
I have several input text boxes. The default value for the boxes is the description of the contents of the box. When the user clicks on the box to type, the default values disappear so they can begin typing. My problem is what if the user forgets what the contents of the box is suppose to be. I am looking for a solution where if the input box is empty, and the user deselects it, the original default value will appear.
Code:
<input type="text" value="Event Name" onfocus="value=''" />
I wanna make simple script that multiply any input by .51 and show the result automatic, without pressing any button, I got two scripts first script add value one to value two and show result auto, other script multiply but I have to press button, how to merge them and if there are script do the job better than those tell me. Input Box, when I input any value the result of multiply that value by .51 appear beside it automatic
Script One:
</head><script type="text/javascript" language="javascript">
function autocalc(oText){
if (isNaN(oText.value)) //filter input{
alert('Numbers only!');
oText.value = '';
} var field, val, oForm = oText.form, total = a = 0;
for (a; a < arguments.length; ++a) //loop through text elements {
field = arguments[a];
val = parseFloat(field.value); //get value
if (!isNaN(val)) //number? {
total += val; //accumulate
}} oForm.total.value = total; //out
} .....
I have two grids, they both display buttons. One grid displays numbers, true or false and yes or no, and the other grid displays letters, true, false, yes and no.
The second grid is not displayed in the code (used css to not display second grid buttons (.answerBtns)) Now using the getButtons() function, if the user selects button "1" in first grid (the grid which you have to open using (Open Grid) link, then it should display button "A" in second grid, if user selects button "2" in first grid, then it should displays buttons "A" and "B" in second grid, if "3" then display "A", "B" and "C" and so on.
Now except using if statements and stating which buttons should be displayed and not displayed depending on the button chosen in first grid, is there a more efficent way of coding this so that the display of buttons in second grid depends on what is selected in the first grid?
If it is using an array can somebody show a sample of this in their answer. You can just do it for one example and then I should be able to use that to fill it for the other buttons.
how can I show / hide the content of sub divs based on whether the input is != or = and be able to repeat this.I tried to hide the sub divs using , onclick if bla bla = '' ;document.getElementById('hideme').innerHTML = ''; which works, but once I try to enter a new input, then nothing happens, even if the content of the sub divs is = input.
View 2 Replies View RelatedSo I am trying to make a form that will eventually take the user to a specified link. It is a form that uses drop down menus. I based this off of someone elses code (with permission :)), but it shows everything <= user input. I cannot for the life of me figure out how to make it only show only one of the next options.here is the JS code:
<script language="JavaScript">
function ShowMenu(num, menu, max)
{
[code]....
I have been studying php for a while now and i know that, i am now starting php oop and that going well but i have never done anything like this. Anway i am creating a booking system which at the end of the process asks who supplied your voucher which they then select a supplier.
The issue i have is my client wants it so if groupon is selected then an input text box should appear so that the user can input a security code from groupon.
So basically it is
<select name="supplier" id="supplier">
<option value="">please select supplier</option>
<option value="Groupon">Groupon</option>
<option value="KGB Deals">KGB Deals</option>
<option value="Other">Other</option>
</select>
So if value="Groupon" then <input type="text" name="security" id="security" /> should appear next to it.
page cant refresh as it will lose its data which would have taken the user about 10 minutes to fill out :(
I need to show the date picker in an input field that is inside a form. I have index.php which has the code for the date picker, I just need to link it to the input field. I have the form in another file as follows:
<form id="inputArea" action="index.php?action=login" method="post">
<input type="text" name="datepicker" value="<?php echo $array['date'];?>"/>
<label for="date">Date of Birth (mm-dd-yyy):</label>
[code]....
I'm having some issues with showing / hiding divs in a form based on radio button input. I'm fairly new to JavaScript so I'm still not 100% on what I'm doing... I have a pretty extensive form with quite a few container divs that are set initially to "display: none" and I need them to be set to "display:block" dependent on radio button input.
For this piece, I need the div with id "SFSCPROJSPONCOMP" to be displayed when the user selects the Radio button with name "PROJSPON" and value "COMP".If someone could provide me with JS code for that example, I can get through the rest of this form with ease.
im having some trouble. im trying to make a text input field appear when i click a certain checkbox and have it be invisible untill said checkbox is clicked. how would i format that with css/html
View 1 Replies View RelatedI am having some jQuery troubles whereby I have some jQuery that toggles an 'Other' HTML input field and associated label when a user selects the value Other from a HTML select drop down. I have this working for one field but the application I am building has increased in scope whereby there may be multiple instances of members on one page so the Other option will be there multiple times. At the moment if a user selects Other from one drop down all Other input fields show. How do I make this exclusive without repeating the jQuery for the separate instances?
// Show/Hide 'Other'
$(document).ready(function() {
$('.jOther').hide();
$('.jTitle').change(function() {
var $index = $('.jTitle').index(this);
alert($index);
if($('.jTitle').val() != 'Other') {
$('.jOther').hide();
} else {
$('.jOther').show();
window.location.hash = 'Other' + $index;
}});
});
<td>
<select id="title" class="inlineSpace jTitle">
<option value="Please select">Please select...</option>
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
<option value="Ms">Ms</option>
<option value="Miss">Miss</option>
<option value="Dr">Dr</option>
<option value="Other">Other</option>
</select>
<label for="other" class="inlineSpace jOther">Other</label>
<input type="text" class="text jOther" name="other" id="other" maxlength="6" />
</td>
For example I have this sort code:
for ($i=0;$i<$db;$i++) {
$t1="toggleh$i";
echo "<div class='c'>Test<input name='$t1' type='image' id='$t1' src='test.png'/></div> <br>";
}
I try to make clear the screen for users, so I use hide & show to hide some row on screen what users actually don't need...
The JS part of code is something like this:
$('#toggleh0').click( function() {
$('div.showhide').toggle(400);
});
$('#toggleh1').click( function() {
$('div.showhide').toggle(400);
});
$('#toggleh3').click( function() {
$('div.showhide').toggle(400);
});
.
.
.
I dont know how can do this dynamic. So if "$i=6;" then I need toggle 0-6 function...
I had a beautiful script written by @rnd me that looks like this:
Code:
<body>
<input id='inp' /> <select id='sug' />
<script type='text/javascript'>
function el(tid) {return document.getElementById(tid);}
function addScript(u){
var head=document.getElementsByTagName('head')[0],
[Code]....
This script made it possible to show Google suggestion while typing in an input field. The Google suggestions are retrieved over here: [URL] The problem is that all of the sudden it stopped working! For apparently no reason because Google is still 'providing' the suggestions online. So I have two questions: Why is it stopped working? Did Google restrict the suggestions to third parties?
I'd like to create a quick and dirty validation method for a form. It's not meant to be very secure.
The way I picture it working is this - there is an input field that asks for a password. If the user types in the password correctly, the "submit" div tag will change from "none" to "block". , which will display the submit button. I just am not familiar with JS enough to know if that's possible.
Here's what I'm starting with:
Code:
I have a perl cgi form that has a popup_list. Based on a value that
is coming in from a database query, I want to either
1) display the value (from the databse) and let the user change it;
OR
2) display the value (from the database), but NOT let the user change
it.
I tried using javascript to disable the popup list, and that works,
except the form "loses" the value of the entry in the popup list.
Maybe "disable" is not the correct property I want to use. If that is
the case, what is it?
I am trying to get the X and Y coordinates to have a pop up form to use as reference, this is a shopping cart so the more items in the cart the further down the page the form needs to open,
i have this CSS:
Code:
#theFormDiv6 {
display:none;
position:absolute;
top:500px;
[Code]....
I am not real good at JS and I am trying to piece together things.
This works in IE but does not in Firefox, when I comment out the getMouseXY() call it works in firefox but obviously doesnt get the new Y value..
anyone know how to make this work in both IE and Firefox??