Change Option Tag Values With Prompt Window Inputs?
Oct 27, 2011
I am working on an interest and investment calculator for a class project. On my list of drop down options, one of the options isnt an integer value like the rest. It's value is "other", while the other three are 1000, 5000, 1000, and 25000. What I would like to do is when the user chooses the "other amount" option from the drop down list, a prompt window will come up asking the user for an investment amount. I am having problems creating a function in my javascript file for this, and then taking the value entered and assigning a variable in another function with that new value so that it calculates with the users input. Please help. The first part of the attachment is the label with the "other" value I explained. And the second piece of code is my mess of a function that I tried to create for the prompt window to come up and store the users value and then change the value of the option.
From: <input type="text"id="from"value="03.10.2010" size="12" /> do: <input type="text" id="to"value="09.10.2010"size="11" /> <input type="submit" /> --> I tried to do it with function ".val();" but value are keeping steady. It can be done any other jQuery function?
In part of my form, I have 3 inputs (one textarea and two text inputs),I am validating their value format using AJAX (each input triggers error message on its label in case format is wrong). Also I have one button, "NOT submit button" (type = button).Now, when clicking on the button it must enter the value of those three inputs in my database in case they are true then all inputs values must be cleared. In case AJAX validation is wrong and in case the user clicked on that button, the value of fields must kept as it is.
Actually I can not use submit button because I have it for the whole form and what I am taking about is a part of the form and it's not possible to make nested forms as I know it violates html rules. It's easy to make it if I am taking about submitting button as I can view session values on fields after submission in case ajax returns error.I can clear inputs from Javascript, but it will be cleared on both cases if AJAX validation true or wrong. Each input field has AJAX Error message that will be triggered when the input format is wrong.
im having a problem with returning the value of a custom prompt box function . and stopping anything from happening while the prompt is open... the problem is with the
Code: alert(prompt('please enter your name')) at the end
Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <style type=text/css>
I want to create a dynamic clickable color picker like this:
When I click a square it has to select a color from the list - it's simple but...
There are inputs with the same name="color_number" - I'm trying to get those values but it returns just the first one, so there's working just first color.
This is my code:
var color_number = $j('[name=color_number]').val(); $j('div.color-picker-'+color_number).click(function() { $j("#input_Kolor option:contains('"+color_number+"')").val(); $j("#input_Kolor option[selected]").removeAttr("selected");
I am trying to change my cursor to a help cursor for a webapp I'm helping to develop. It partially works, except when an element has a CLASS attribute. For example:
I need to count if a hidden input has a .com , a .net or a .org.I am thinking I need to use a filter.there are many inputs that may have these values. I need to find a way to just countthe input values that have these.how would I do this. Would I need to use the filter function in jquery?
I got the following script to work the way I want it by adding new text inputs with new name values, but if there is data added and the add button is clicked again everything disappears. Is there any way to keep the data from going AWAL?
I have been working with with window.promt() and i noticed a weird behaviour.In some cases (i do not known why) my prompt cannot get over a certain limit of characters. But in some other cases it can get as many characters as i want.
i faced a problem in java script which is when i want to prompt a message box and enable to let user to type their own password. but i found that a problem is when the user type their own password in the prompt box's text box, the text box's text mode is normal but not password mode. So to prevent more security and don't allow other people see the password when typing, what should i do? or have other ways to let me finish this task?
I have a form that is initially submitted by normal submit button, but after that I want it to resubmit on change(). I thought I'd be able to pick up the secondary change()s by adding a class to all of the inputs. However I now understand that won't work by default because the change() can't be attached to the class added by the the submit() as it didn't exist at the time, it was added by Jquery. I've since discovered on() but I'm now stuck on where to include it.
Here's the script so far: The submit() adds the 'stu' class, and then the change() tries to select it but can't <script> $(document).ready( function(){ $("#search_choices").submit( function(evt){ runSearch(); $("input").addClass("stu"); evt.preventDefault(); }); }); $('.stu').change( function(){ runSearch(); });
function runSearch(){ var sFor = $("#for").val(), sWhere = $('input[name=where]:radio:checked').val(); $("#search_results").load('search.php', { where: sWhere, treb: sFor } ); }; </script>
Is it possible to use a function to pad option values in a drop down box? I need to pad 5 values in a drop down box 15 characters with balnk spaces then add a "1" on the end.
I am doing an application with two dropdown boxes.Once we change the value of first drop down using database values ,the values in the second drop down should change..then click on done it should display the data from databse.. first dropdown :contains country names second dropdown :contains city of particular country..My problem here at is displaying values on second drop down based on first drop down selection:
When using jQuery Cycle as a text scroller, because IE7/8 render text ugly when fading in and out, it's better to make text has no transition effect on IE7/8.
Instead of the following long-winded code, can we re-write one option value (ex: speed) only for IE7/8 after the text scroller has been launched?
I need to have someone give me a hint or show me an example where I can retrieve all the values of the options of a dropdown list, also I've created a dropdown list with Jquery and it looks good in all browsers EXCEPT IE7???? I thought that jquery was cross-browser compatible???
but it isn't right. It breaks the javascript, and doesn't run at all. Anyone have some clues or answers for me? I don't use jquery or javascript enough to figure it out.
The function "addPhrase" is where i know i'm having the difficulty - so for now I've forced it to show one value only:
'// The form name is AMANDA
function addPhrase() { document.AMANDA.js_strMemberMail.value = document.AMANDA.js_strPreDefCatList.value + ", " ;}
What I think I want is to be able to build up a string of values and write them out to the textarea (hence the ", "). With the option that more can be added, without deleting what's currently there.
I want the drop down to "activate" the option values in the input field. So, when the user changed the options, they wil automatically appear int he input field.