Dynamic MCQs - Error Alert If User Selects Wrong Choice?

Nov 2, 2009

I am creating dynamic questions and question's choices (radiobuttons or checkboxes) from database when runtime..after users answer the question, press next button to pass the next questions

For example
1) Question definition
a)choice definition
b)choice definition
c)....

Users have to choose any choices..if not, my system is giving alert, Actually my problem is about checkboxes. I created hidden textboxes, if question choices' type is checkbox. So the last choice definition is name "Other". If user checks the other choice, the hidden textbox is going to be visible. It is all okay until here. I want to give a error alert if user checks the other choice and doesn't fill the textbox when press next question. I don't validate this. How can i do it.

View 2 Replies


ADVERTISEMENT

Create User Choice Alert?

Feb 16, 2009

I want to make different style of alert box on my code how to make user choice alert box.

View 1 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 :: 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

Dynamic Multiple Selects

Aug 8, 2005

I want to do the following:

If one entry in multiple select "domain" is selected, i want to change
the content in dropdown "typ" dynamically according to the selected
domain.

If more than one entries in domain are selected, i want the dropdown
typ to disappear

here the javaScriptCode that causes an "typ has no properties" -Error:

View 1 Replies View Related

Dynamic Array From Users Input Choice?

Mar 24, 2010

I'm attempting to make user's input choice dynamically create the scrambled word game. The only thing that changes between the HTML page, and the JS files is the Array used to make the game. I researched Dynamic Arrays, but was confused, as nothing seem related to what I'm doing. What I've got going is all wrong. I know there is a better way to do this, but am confused. SelAry I've tried using too, but I can't get that code to work either. I don't know where to put the eval function. I know that window onload is not preferred, but am too confused.he crap code, using my crap method:

<SCRIPT LANGUAGE="JavaScript"> <!--
function myChoice()
if(myChoice = 1a) {

[code]....

View 13 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

Open URL Either In A New Window Or New Tab Based On User's Choice?

Nov 14, 2011

I am facing an issue where a link on my website opens in a new window if you simply click on it. However, if you right click and say open in new window or new tab, it opens the same window (URL) again from where the link is clicked.

Self Service Option is a link and the JSP calls a function getSelfServSite() when the link is clicked. This is how the code flows in my case

function getSelfServSite()
{
getToTheLink("${myConfigInfo.selfServiceURL}");
// this is because the URL is configurable

[Code].....

I want it to go to the right link no matter how the user click it.

View 1 Replies View Related

Allow The User To Chose One From A Select Form (Choice)?

Feb 12, 2011

I am working on a little project here. I have two arrays (States, Cities) I am trying to allow the user to chose one from a select form (Choice) and then have the values of the chosen array displayed in a alert(). Obviously I could just write an if statement and display the required content depending on whether the value selected == States or Cities. But this project is just a placeholder project for me to figure out one aspect of a much larger project I am working on. And it is important for the result to be chosen dynamically as in the final project I won't know the values that the select field is being filled with.

What I need to do is take the value returned from the select field (Choice) and turn that into the name of the array and display that. If I use this code alert(States); then it returns the values of that array. But like I said I need to be able to dynamically select what array to display based on users input.
alert(document.getElementById("Choice").value); returns the value chosen. How can I take the value chosen and actually display the value of the array with that same name. In other words let JS know that I don't literally want it to display the value chosen but rather the value chosen is the name of the array I want it to display?

Pseudo code
x = document.getElementById("Choice").value;
x is name of array;
alert(x);

View 2 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

Reset User Choice Of Radiobutton - Doesn't Work

Aug 10, 2009

I want reset user choice of radiobutton here is my code

[Code]..

but in some reason it doesn't wotk ,what is wrong with it?

View 4 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

JQuery :: H5validate - Livequery - User Selects From A Dropdown Menu - Via AJ

May 27, 2011

I'm currently using h5validate with my forms but recently setup a few where a second form is generated based on what a user selects from a dropdown menu (via AJAX). Since the new form ID's were not existing when the document was loaded jQuery does not bind h5validate to the new form. I found a plugin called livequery that will bind new elements on the fly. Unfortunately, I'm pretty new to jQuery and can't quite figure out how to make this work with h5.

My current h5 function looks like this, where formID is the ID of the from that does not exist but is later loaded in via AJAX.

Here are the sites to the two plugins:

View 2 Replies View Related

OnClick - Show Image + Link - Displays Whenever The User Selects A Combination

Nov 14, 2010

I opted to use JavaScript & PHP (instead of Flash) to create a sort-of "t-shirt designer" -- basically, it's a gallery-type script that allows users to scroll through t-shirt styles, swap colors, and so on, prior to reaching the actual design tool. And I'm starting to regret.

It's actually working very well so far, except for one thing: I want the t-shirt option that the user selects to link the user to the design tool. The "gallery" already has an image for each possible option that displays whenever the user selects a combination, but I want to make that image is a clickable link.

I have no idea where to start -- I know next to nothing about javascript -- and to accomplish this in Flasjh I'd have to start this stupid basic thing all over again from scratch, and it would defeat the point of not using Flash in the first place, so

View 2 Replies View Related

Preventing User From Uploading Wrong Image

Jan 26, 2009

I am trying to prevent the user from uploading an image that is more than 1048576 bytes and is not a jpg. I have been testing the following code but it isn't working for me.

View 1 Replies View Related

JQuery :: Replace The Entire Page When The User Selects Adifferent Option In A Combo Box?

Sep 5, 2009

I am trying to replace the entire page when the user selects adifferent option in a combo box. The code I have works for the firstiteration. However, It fails everytime there after.I went throughfirebug and it appears after the first refresh it never triggers theready() method.My Code is,

<script type="text/javascript">
$(document).ready(function() {
$("#id_company").change(function () {

[code]....

View 1 Replies View Related

JQuery :: Dynamic List - Remove Function Works Wrong

Aug 30, 2011

I'm working on dynamic list with jQuery. I've appended hundreds of <li> elements with for loop to make very long list. When user scroll down again, remove older ones and append new ones at last of the list. I used$('li:lt(50)').remove() to remove first 5 elements from the list. At first, it works. But, for the second time, it always delete half of '50'. When I enter 100, only 50 elements deleted. How can it be? Could you check the ':lt(n)' selector and remove function? My HTML is very simple. only <UL> <LI> tags in the body. Tested on latest Chrome(ver.13.0.782), jQuery 1.6.2.

View 1 Replies View Related

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 View Related

DropDown Boxes - If The User Click On A Wrong Option It Will Show A Box

May 11, 2011

I have a drop down box (select) in my website: [URL] that works fine; but the problems is if the user click on a wrong option, it will show a box and if the user click on another option from the box, the last one will be on display and won't go off..

Like this select something and then at the same box change the selection you will see the code will build up boxes on the screen.. How I do for it not happens if the user change the option in the last box, the one before disappears!

View 6 Replies View Related

Error = "The Phone Number Is The Wrong Length?

Aug 1, 2010

I have forum validation script but this script cant validate the phone number field. My script:

if(document.getElementById('user_phone').value=='')
{
alert(Please, enter <?php _e(PHONE_TEXT) ?>');

[code].....

View 10 Replies View Related

Wrong Values Passed To Function - Invalid Character Error - Arises When Pass The "whereVARquoted" Variable Intofunction

Feb 19, 2009

I am writing a Javascript to sort and write out some stuff. PHP is not an option so I need to get this script working.

The problem arises when I want to make a link to the next page. (i.e. Like the link in google for the next 10 results)

I have <a href=# onclick=FUNCTION(VALUES)> written dynamically by the script.

It is written onto the document correctly, but the problem is, when the link is clicked, some seemingly random values are passed to the function.

I also have an invalid character error that arises when I pass the "whereVARquoted" variable into my function (code 2) which disappears when the variable is removed (code 1).

My code is below:

Code 1:

<script>

Code 2:

<script>

View 3 Replies View Related

Alert User They Are About To Make Changes?

Mar 25, 2011

So with the below form if the value of any of the select list changes the user is alerted something like "You are about to make 2 changes". How can I do this?

<script>
function validate(){
}
</script>
<form method="POST" onsubmit="return validate()" action="--WEBBOT-SELF--">
<select size="1" name="fruits[]">

[Code]...

View 9 Replies View Related

JQuery :: Validation Dynamic Rules - Add In Rules Dynamically Through The Rules(add) Function After Adding Some Dynamic Fields Through The User Inputs

Sep 6, 2011

I will like to know if there is anyway to view all the rules that I have currently in the Jquery validation plugin. Currently, I am trying to add in rules dynamically through the rules(add) function after adding some dynamic fields through the user inputs. the rules are added in this manner.

[Code]...

View 2 Replies View Related

How To Alert If User Scrolls Down The Page

Apr 28, 2010

" how to write a JavaScript function to pop up an alert() if a user scrolls down the webpage faster than a certain speed"

View 1 Replies View Related







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