Create A Form That Expands Or Collapses With More Or Less Fields To Fill In When The User Selects Or Deselects A Check Box On It?

Apr 6, 2010

I need to create a form that expands or collapses with more or less fields to fill in when the user selects or deselects a check box on it. This form also needs to be secure. What is the best way to accomplish this?

View 19 Replies


ADVERTISEMENT

JQuery :: Accordion Menu That Expands And Collapses Fine

Apr 1, 2010

I've got an accordion menu that expands and collapses fine, but when I click on the links contained in the lists within the links don't open.

JavaScript snippet:

Code:

And the code for the lists:

Code:

If I remove the return false, the inner links work fine but it appends a '#' to the end of the URL in the address bar and I'd rather it didn't do that. How can I alter the jquery so the inner links still work but the links with the '#' as href don't append the '#' to the end of the page URL?

View 4 Replies View Related

Create A Script That Will Validate All Of The Text Boxes The User Must Fill Out By Ensuring?

Jun 5, 2010

I need to create a script that will validate all of the text boxes the user must fill out by ensuring that:

1. the user inputs doesn’t leave any boxes empty
2. the user inputs a valid zip code
3. the user inputs a valid a email address

<!-- Hide script from older browsers
function isNum(passedVal) {
if (passedVal == "") {
return false

[Code]...

View 2 Replies View Related

If One Selects Merge, Then Want Another Form Displayed With Input Fields?

Oct 18, 2006

Given a drop down list such as:

Code:
<SELECT NAME=sections >
<OPTION>Merge</OPTION>
<OPTION>Nuke</OPTION>
<OPTION>Merge & Nuke</OPTION>
</SELECT>
If one selects Merge, then i want another form displayed with input fileds etc.

Can anyone show a script (i.e. javascript) that does just that or care for a example?

View 3 Replies View Related

JQuery :: Not Refreshing Page - Form That A User Selects Item From Dynamic List

Mar 26, 2011

I have a search form that a user selects item from dynamic list hits the submit button and it returns each matchingresulton same page in an update form, i have 2 checkboxes in update form that updates the DB when 1 is checked, this all works fine until i check the checkbox the data updates ok but allremainingupdate forms are removed because the page refreshes.

So i need to update formstwith out page refreshing but i cant get it to work with multiple forms on same page.

View 2 Replies View Related

Auto Fill Form Fields With Mysql Data For Selected Pull Down Option

Nov 28, 2004

I have some form fields that the user can either type in or he can check a checkbox so that MySQL data for an option selected from a dynamically generated (PHP/MySQL) select menu is filled in. How can this be implemented? I have the code for the select menu.

View 3 Replies View Related

Dynamic Drop-down List - Create A Dynamic Menu Where A User Selects One Item And Another Select List Is Shown

Jun 30, 2009

I've been beating my head against a wall for a few days trying to get this working. I'm trying to create a dynamic menu where a user selects one item and another select list is shown, then another and another (and so on). Here is my JS, it *should* be taking the ID of the div, comparing it to the selected value and then showing another div by settings it's class property to visible:

[Code]...

View 1 Replies View Related

JQuery :: Check All The Fields In A Form?

Feb 14, 2011

I have this form

<form method="post" action="urlymsite">
Name<input name="name"> <br />
Autor <input name="autor"><br />
telephone<input name="telephone"></td><br />

[Code].....

I would like to cycle all the input fields of the form and see if there is at least input fields empty.

I would like to use the .each(),avoiding the control field to field,

View 1 Replies View Related

Comparing User Form Fields?

Jun 13, 2002

I want to put a form on my site where the user can enter some information, but I don't want the user to enter the same information twice over the couple of fields that I have.

Is there a javascript that can help to validate the form information or some other way? And if so, is it easy to do?

View 7 Replies View Related

Script To Check Both Fields In Form Before Submitting?

Nov 10, 2009

I have this Form, where there is a field that requires a number to be entered into it. How can I add the function where the number has to be re-entered into the next field, and match the original number field? I want to check that the number in both inputs is the same before the form will be submitted successfully.

Code:
<html>
<head>
<title></title>
</head>
<body>
<br>
<h1 style="border-bottom:1px solid #dddcdc;"><br><center> Form</center></h1>
<p><center><font face="verdana"><font size="2"><font color=#000000;"></font></font></p>
<p><font face="verdana"><font size="2"><font color=#800000;">Please complete the simple form below.</font></font></p>
<p><font face="verdana"><font size="2"><font color=#000000;">.</font></font></p>
<p><font face="verdana"><font size="2"><font color=#000000;"> </font></font></center></p> .....

View 1 Replies View Related

Clear Form Fields When A User Clicks On Them

Dec 1, 2010

I need to learn how to clear form fields when a user clicks on them. Here is the site in question: [URL] They used to work, but then I changed the field value and now it doesn't work on some of the fields (whichever ones I changed). Here is a link to the .js file:[URL]

View 2 Replies View Related

Create Some Amendments Within Some Form Fields?

Feb 13, 2009

Im trying to create some amendments within some form fields as the files that need to be adjusted in the php scipts are encrypted. so im forced to use a work around. I'll explane best what i want to do via the very simple php script below.first the form fields (all field names are related to there php objects)

----------------------
<--! this is the "title" field -->
<td><input type="text" name="title" style="width: 100%" value="we are her" /></td>[code]....

how could i have the same disired effect in Javascript or maybe theres another solution?

View 1 Replies View Related

Search Depending On What User Selects

Jul 20, 2005

what i want to do is create several radio buttons and a textbox for
searching purposes. the search will perform a search depending on
which button the user selects.

here is what i have now:

- for each radio button, i use the onClick event handler, which calls
a function called showMe()

- showMe() {
if (button 1 was selected)
document.write('form which will search down path A');
else if (button 2 was selected)
document.write('form which will search down path B');
else if (button 3 was selected)...
}

this works, but once the user makes their selection, the search form
will pop up on another page. how do i fix it so that the search form
will display on the same page as the radio buttons? Is there any
other way to accomplish this?

View 1 Replies View Related

Show Text In Search Box After User Selects Something?

Sep 8, 2010

I have this search box form with 2 select boxes :

<form action="search.php" method="get">
<select name="RingType">
<option value="Nose">Nose</option>
<option value="Toe">Toe</option>

[Code]....

For example, when a visitor selects "Belly" RingType, I want "Belly Ring" to appear in the search box.

and

when the visitor selects "pearl" NecklaceType, I want "pearl necklace" to appear in the search box.

if the visitor first selects "Belly" RingType, and then selects "pearl" NecklaceType, I want "Belly Ring pearl necklace" to appear in the search box.

After making his selections in the search box, if he types something in the search box, it should add to what is already there in the search box. Or, if he first types something in the search box for example, "jewelry" and then selects "pearl" in the necklacetype select box, the search box should show : "jewelry pearl necklace"

View 8 Replies View Related

Function Works When User Selects Value, But Not In Value Preloaded?

Mar 30, 2011

I have a script one of my pages which is designed to prevent a user from selecting the same option from a drop down more than once. Here is the script:

Code:
function changeSelect(sel) {
option = sel.selctedIndex;
var sels=document.getElementsByTagName("select");

[Code]....

Here is the basis: A user is greeted with a page of blank fields. On the right is a drop down menu which has the select options you see. The user enters the address of a few DNS servers, then selects their main and least favorite DNS of the group. If there is a "Main DNS" already selected, it will blank the originally selected drop down, and fill in the newly selected drop down.

The problem I'm having, is when the user calls their settings back, the PHP will load the proper "main" and "last" options, but I have to select two more to get it to blank. I know this is because the script is called with an "onchange" function, but I've tried using "onLoads" and I've also tried making a quick function to "select" the option, but to no avail.

View 1 Replies View Related

Preserve User-entered Quote Marks In Form Fields?

Apr 10, 2010

I have a JavaScript application that needs to preserve double quote marks and apostrophes (" and ') that are entered into form fields by the user. The form data is passed through several screens using hidden fields.

Right now, apostrophes work because I have the input fields coded as value="". I have not found a way for JavaScript to retrieve the field's value if double quotes are entered by the user. If I change the parameter to value='' (single quotes) then the apostrophes probably won't work.

Is there a straightforward way for JavaScript to retrieve the field value containing quotes, so that I can manipulate it into a different string that can be easily passed between HTML pages?

View 3 Replies View Related

Create JS Array From Dynamic HTML Form Fields?

Apr 26, 2011

From the these form fields I want to be able to create an array in Javascript containing the same 'codes' that feature between the option tags (not the value="X")

<select name="options-1" id="options-1">
<option value="">Select an option</option>
<option value="1">KA-WH</option>
<option value="2">KA-BK</option>
<option value="3">KA-GN</option>

[Code]...

for example, from the above, I want a JS array for 'option-1' that contains KA-WH, KA-BK and KA-GN; plus an array for 'option-2' that contains BADGE-1, BADGE-2 and BADGE-3. The above form fields will be created dynamically, may contain more or fewer items.

I then want to use the JS arrays to pull in images of which filenames match the 'code' in the array.

View 13 Replies View Related

Create A Form In Which Visitors Can Add Input Text Fields?

Feb 13, 2010

I want to create a form in which visitors can add input text fields like this:http://img269.imageshack.us/img269/5268/pictureli.jpgNote that you should be able to add/remove both new person and children to those persons.How do I solve this? Im pretty new to JavaScript, maybe this project is waaay to hard for a beginner?

View 3 Replies View Related

Create A Form Which Has A Dynamic Number Of Text Fields?

Sep 24, 2011

I need to create a form which has a dynamic number of text fields. So, I created this input type :

PHP Code:
<input id="benamount" name="benamount[]" type="text" disabled="disabled" size="40"/>
<input type="checkbox" name="ben[]" onchange="check();"/>

[code]....

View 2 Replies View Related

JQuery :: Validate: Check Certain Form Fields Depending On Button Pressed?

Feb 4, 2011

I have a form with a series of fields. Only certain fields need to be validated when certain buttons are pressed. The reason for this is mainly because I had to build my own wizard style setup with jquery so, even though it's one big form, only certain bits need to be checked as they progress. I tried to tweak the accordion example given by the creators but it can't really apply to my scenario.

I've simplified the code down a bit and it is behaving exactly the same way as the big form...which is to say it's not behaving at all.

In this code, I want it to only validate field txt1 if button 1 is pressed and text2 if field 2 is pressed. One odd thing to note, when I set it up exactly as the site recommended with one big mass validation and such, it would only acknowledge the existence of the first field even though they both had class="required" on them.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head >

[Code].....

View 2 Replies View Related

If A Check Box Is Or Not Empty - Allow User To Have One Box Checked At Any Time In A Form

Mar 31, 2009

I'm trying to figure out with Java Script how I would have Java Script check and see if a check box is or not empty. The goal is to only allow the user to have one box checked at any time in a form. That means, if they click on another one and there is already one checked, it would uncheck the one that was checked and make the one that the person checked on next checked.

View 4 Replies View Related

Allowing User Check / Uncheck All Checkboxes In Form

Dec 20, 2011

I am trying to allow a user to easily uncheck/check all checkboxes in a form by checking or unchecking a checkbox. The checkboxes would be in a form like so:
<form action="" method="post">
<input type="checkbox" name="checked[]" value="1">
<input type="checkbox" name="checked[]" value="2">
<input type="checkbox" name="checked[]" value="3">
<input type="checkbox" name="checked[]" value="4">
</form>

I use an event handler to call a function:
<input type="checkbox" name="checkall" onchange="checkall('checked[]', this.checked)">

And here is the function:
function checkall(box_name, current_state) {
all = document.getElementsByName(box_name);
action = (current_state == "checked") ? "false" : "true";
for (i = 0; i < all.length; i++) {
all[i].checked=action;
}}

The event handler should pass the name of the checkboxes and whether the "check all" checkbox is currently checked or not to the checkall() function. Nothing happens when I check/uncheck the "check all" function.

View 2 Replies View Related

JQuery :: Catch The Value Of <select> When A User Selects An Option?

Aug 15, 2011

how can i cath a html <select> event? i have a <select> list... i want to catch the value of <select> when a user selects an option..

View 2 Replies View Related

JQuery :: (autocomplete) Not Selecting Value Unless User Explicitly Selects It?

Sep 30, 2009

I'm using the jquery autocomplete plugin.Suppose the user starts typing, and the autocomplete presents a drop-down of possible values. If the user presses return, the first valuein the drop-down is selected.What I want instead is the user experience that Firefox's search boxprovides: As the user types, search suggestions are offered. If theuser presses return without selecting a suggestion, what the user hastyped so far is submitted. And of course, if the user does explicitlyselect a value from the drop-down, then the selected value is

View 1 Replies View Related

Creating A Form That Will Change The Number Of Fields Based On User Input

Jan 4, 2006

I have a form that collects information about up to 5 items. I would
like the user to be able to select from a drop down menu how many items
for which they want to compare information, and then have the form
change the number of input fields accordingly.

In other words, if the user selects enter info for 3 items, then input
fields for only 3 items are shown, if they change it to 4 items, then a
fourth column shows up in the table with the appropriate input fields.

View 2 Replies View Related

Form For Users To Create Events - Populate Select Fields

Jun 3, 2009

I'd like some direction on creating a small piece of Javascript that will populate my <select> boxes. Basically, I have a form for users to create events, with a start time and an end time. (These are the two select boxes). For example:

Code:
<select id="startTime">
<option value="12:00AM">12:00AM</option>
<option value="12:15AM">12:15AM</option>
etc.....
</select>

What I am trying to do is:
1) Have times populated in 15 minute incrementals from 12:00AM to 11:45PM
2) Have some type of "error checking" available to where the End Time must be after the start time. It would be nice for the script to automatically change the end time field to a time that is after the start time.

View 3 Replies View Related







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