SEARCH YOUR SOLUTION HERE  

Selecting at least one field is not working

Hi to all
i have done validation on single fields but i have to apply validation on 3 text field that at least one of thre is filled .i make a code but that logic doesnot work .. html code ID Technologies First Name: Last Name : Organization Name: Email: Contact Number: Duration in years:
Extend
Read Only

Download link

MAC ID: CPU ID: MotherBoard ID:


js code function validate_required(field,alerttxt) { with (field) { if (value==null||value=="") { alert(alerttxt); return false; } else { return true; } } } function validate_email(field,alerttxt) { with (field) { apos=value.indexOf("@") dotpos=value.lastIndexOf(".") if (apos

Posted On: Sunday 25th of November 2012 08:48:49 PM Total Views:  141
View Complete with Replies




Related Messages:

[RESOLVED] Select - display content before actually selecting an option   (68 Views)
Hi. I have two conditional select boxes: Code: $(document).ready(function () { $department = $("select[name='prod']"); $ph = $("select[name='ph']"); $department.change(function () { if ($(this).val() == "Apple") { $("select[name='ph'] option").remove(); $("Iphone 4").appendTo($ph); $("Iphone 5").appendTo($ph); } if ($(this).val() == "Samsung") { $("select[name='ph'] option").remove(); $("Galaxy S III").appendTo($ph); $("Galaxy S II").appendTo($ph); } if ($(this).val() == "Nokia") { $("select[name='ph'] option").remove(); $("Lumia 900").appendTo($ph); $("Lumia 800").appendTo($ph); } if ($(this).val() == "HTC") { $("select[name='ph'] option").remove(); $("ONE X").appendTo($ph); $("ONE S").appendTo($ph); $("ONE V").appendTo($ph); $("Dee C").appendTo($ph); } if ($(this).val() == "Brand") { $("select[name='ph'] option").remove(); $("Model").appendTo($ph); } }); $(function() { $('#btn').click(function(){ $('.phone').hide(); $('#' + $(this).val()).show(); }); }); }); HTML Code: Brand Apple HTC Nokia Samsung Model iphone4 iphone5 Etc... The conditional select boxes work fine, but try to select "Apple" - how do I display the selected option of #selector when the input button is clicked
[RESOLVED] Select - display content before actually selecting an option   (88 Views)
Hi. I have two conditional select boxes: Code: $(document).ready(function () { $department = $("select[name='prod']"); $ph = $("select[name='ph']"); $department.change(function () { if ($(this).val() == "Apple") { $("select[name='ph'] option").remove(); $("Iphone 4").appendTo($ph); $("Iphone 5").appendTo($ph); } if ($(this).val() == "Samsung") { $("select[name='ph'] option").remove(); $("Galaxy S III").appendTo($ph); $("Galaxy S II").appendTo($ph); } if ($(this).val() == "Nokia") { $("select[name='ph'] option").remove(); $("Lumia 900").appendTo($ph); $("Lumia 800").appendTo($ph); } if ($(this).val() == "HTC") { $("select[name='ph'] option").remove(); $("ONE X").appendTo($ph); $("ONE S").appendTo($ph); $("ONE V").appendTo($ph); $("Dee C").appendTo($ph); } if ($(this).val() == "Brand") { $("select[name='ph'] option").remove(); $("Model").appendTo($ph); } }); $(function() { $('#btn').click(function(){ $('.phone').hide(); $('#' + $(this).val()).show(); }); }); }); HTML Code: Brand Apple HTC Nokia Samsung Model iphone4 iphone5 Etc... The conditional select boxes work fine, but try to select "Apple" - how do I display the selected option of #selector when the input button is clicked
[RESOLVED] Select - display content before actually selecting an option   (76 Views)
Hi. I have two conditional select boxes: Code: $(document).ready(function () { $department = $("select[name='prod']"); $ph = $("select[name='ph']"); $department.change(function () { if ($(this).val() == "Apple") { $("select[name='ph'] option").remove(); $("Iphone 4").appendTo($ph); $("Iphone 5").appendTo($ph); } if ($(this).val() == "Samsung") { $("select[name='ph'] option").remove(); $("Galaxy S III").appendTo($ph); $("Galaxy S II").appendTo($ph); } if ($(this).val() == "Nokia") { $("select[name='ph'] option").remove(); $("Lumia 900").appendTo($ph); $("Lumia 800").appendTo($ph); } if ($(this).val() == "HTC") { $("select[name='ph'] option").remove(); $("ONE X").appendTo($ph); $("ONE S").appendTo($ph); $("ONE V").appendTo($ph); $("Dee C").appendTo($ph); } if ($(this).val() == "Brand") { $("select[name='ph'] option").remove(); $("Model").appendTo($ph); } }); $(function() { $('#btn').click(function(){ $('.phone').hide(); $('#' + $(this).val()).show(); }); }); }); HTML Code: Brand Apple HTC Nokia Samsung Model iphone4 iphone5 Etc... The conditional select boxes work fine, but try to select "Apple" - how do I display the selected option of #selector when the input button is clicked
Unselecting specific item in listbox   (79 Views)
I have a listbox set up so users can select multiple choices. I want to limit them so they can choose no more than 4 at a time. I have set up javascript code to do the check on the number of choices selected but what I want to do is if they choose more than 4 (i.e. 5), I want to unselect the last item they selected. I cannot figure out how to determine which was the last item selected. function HasExceededMaximumYearWeekCount() { var count = 0; for (index = 0; index < fmDetailQuery.lstYearWeek.options.length; index++) { if (document.all.lstYearWeek.options(index).selected) { count++; } } if (count > 4) { alert("You can only select a maximum of 4 year weeks at a time.") return false; } return true; } I have tried doing a check on this value: fmDetailQuery.lstYearWeek.selectedIndex but it always returns me the first item in the listbox that was selected (i.e. the one at the top of the list that was selected). I want the last item the user selected, is there a way to determine that
How can I disable some form fields when selecting others   (250 Views)
Greetings experts, this is my first time here. So, please take easy on me. I have makup with 2 sections. The first section contains 5 form fields and are required. The second second has 2 form fields and are optional. Users can only choose from one section or the other but not both. The js script below ensures that if users select from section 2, section one will not challenge for validation and works a treat. The challenge I have now is to ensure that if users choose from section 1, the 2 form fields in section are automatically disabled so they won't be attempted to choose from it. Similarly, if users select from section 2, all form fields in section one are automatically disabled so they won't be tempted to choose from that section. Is this possible If not possible, is it possible to raise an error For instance, a user selects from section 1 and attempts to select from any of the 2 form fields in section 2, a message that says, "You can only select from one section but from both. Similarly if a user selects from section 2 first, same thing happens.
Javascript - Drop Down for selecting # of results/pg   (91 Views)
I don't know anything about javascript so the way I word this might be a bit confusing. I am making an online store using corecommerce but I am having difficulty finding a code that will allow my visitors to determine how many items they see per pg. The options would be: 25 items 50 items 75 items View . I have been playing around with codes that I find.. but like I said earlier, I know absolutely NOTHING about javascript. Can anyone help me out by either giving me the code or pointing me to a tutorial or anything! PLEASE! thx a bunch P.S. if you know of a program or software thats also great too!
Disable selecting text on double click?   (111 Views)
Hi I was wondering how i can make it so when the person double clicks my it does not highlight other divs with text inside it. I still want them to be able to drag over and highlight the text but when they double click I don't want the text to highlight. Basically my is an ad which they can double click to get more information. But there is also a picture, and some text inside that ad. So when they double click the ad how do i disable highlighting the text
How to intregrate javascript code of selecting dropdownlist?   (174 Views)
I have designed a masterpage in asp.net. There is a dropdown list in my asp.net form which select that masterpage. But each time when I select an item from the dropdownlist the entire page gets refreshed. I want a javasript code to block the refresh of dropdownlist item selection and as well as how to intregrate the code in my form. I am a beginner. Please somebody help me.
Searching and selecting people   (101 Views)
I'm creating a message system for a website, and I'd like to create it so you can input a user and then select them from a drop down menu. This I don't think will be too hard to find a resource on, but what I can't seem to find information on is how to do it so that user appears in the To: field (like how they do it on FB and many other places) so that you can see that user is selected, and click an X. Does anyone have any resource they can provide me with as to how this can be accomplished Or at the very least just a brief explanation I just don't understand how to style in textfields, then make those deletable.
selecting an option changes the availablity or other option in the for   (84 Views)
i wish to have options show or not show depending on the options selected previously i think i would be right in saying this needs to be client side and think it must be javascript that is needed here. correct me if i am wrong. either way what method should i use and what is the coding needed to do this. i have no idea where to start of the sort of code i will need and would appreciate it if some one could start me off so i can add the bits of code to the rest of my form. Untitled Document if A has content then B and C are not usable A   B   C   if D is changed or is not the default 'select an option' then E and F are available to alter and add data to the fields E and F D select an option opt 1 opt 2 E opt 1 opt 2 opt 3 F
selecting option on menu A changes the options available in menu B   (86 Views)
Please can someone help me here as i have no idea what i need to do or where to start. this is the method i as trying to do... Untitled Document L1 - OPT 1 L1 - OPT 2 L1 - OPT 3 L2 - OPT 1 L2 - OPT 2 L2 - OPT 3 L3 - OPT 1 L3 - OPT 2 L3 - OPT 3 L4 - OPT 1 L4 - OPT 2 L4 - OPT 3 i have ben given this code to use but it does not allow me to get the data on the fly from the mysql database for each of the 'topic' title. window.addEventListenerwindow.addEventListener('load',function(){ ray.init(); },false):window.attachEvent('onload',function() { ray.init(); }); // FF: IE var ray={ clone:'', init:function(){ var opt = document.form2.select1; // Select1 dropdown var clone = document.form2.select2; // Select2 dropdown this.clone=this.clone==''clone:this.clone; opt.onchange=function(){ ray.setOpt(this.value=='L1 - VALUE 3'4:this.value=='L1 - VALUE 2'3:2); } }, setOpt:function(base){ var HTML=''; for(var i=1;i value="">
ctrl clk is selecting parent elements also in jquery   (138 Views)
I have multiple divs inside a div. I am using jquery event.ctrlKey to select inner divs on ctrl click. It is working, but there is one problem. When I click on inner div elements, it selects parent div also(it gives blue border showing as selected for parent div). When I hover over the parent div after selection, blue border is gone. I dont want that blue border selection for parent div. Any suggestions how to remove that What is the reason it is getting selected
Regex for selecting specific URLs   (110 Views)
Hi , JS isn't my usual language, but I'm venturing out to write a Chrome extension. This extension basically just injects a script on a page, so it behaves just like any other JS. Anyway, the script finds specific URLs on a specific page, and changes them slightly. I'm using regex to find these URLs. I've got one working, but I need another, and I can't figure it out. The first is this: "http:\\/\\/www.reddit.com\\/r\\/\\S*\\/comments\\/\\S*\\/$)" Also, my skills with regex are miserable, so if you know of any way to make this better, I'm all ears. This matches URLs like this: http://www.reddit.com/r/gaming/comments/khsha/wtf_is_a_katamari/ http://www.reddit.com/r/anything/comments/hash/anything/ Now I'm trying to match URLs like this: http://www.reddit.com/r/gaming/comments/khsha/wtf_is_a_katamari/c2kck9i http://www.reddit.com/r/anything/comments/hash/anything/anotherHash If you know how to modify the original regex so that it'll match the second kind of URL (but not the first), or some way to make them both better, please let me know.
selecting option on menu A changes the options available in menu B   (105 Views)
i wish to be able to move topics around in my forum i have created, in my admin i done i have two options the category pull down menu and a topic menu, what i would like to do it when the category menu is selected the topic menu changes to show the topics available in that category and these topic 'titles' i got from the mysql database. i have been told that i should use ajax but have no idea where i start to get data from the database using this. can someone please help start me off. value="">
After selecting dropdown selection display DB data?   (101 Views)
I am new to AJAX and want to create something with three dropdown boxes. When a user selects the first one, the second dropdown populates with the corresponding fields, and when they select something from the second dropdown, the third populates. After selecting an option from the third dropdown I want a table to display all information from the database that corresponds to the selected row. I have found an example online, but am having trouble modifying it. I am only able to display one field. This is the code: ajax_select.js // function used to remove the next lists already displayed when it chooses other options function removeLists(colid) { var z = 0; // removes data in elements with the id stored in the "ar_cols" variable // starting with the element with the id value passed in colid for(var i=1; i
help with checking/unselecting with single checkbox   (149 Views)
hi i have created function that automatically adds rows with chekcboxes. i can create two button that one serves checking all checkboxes and the another one serves for unchecking rows. but i would like to check/uncheck all checkboxes with single checkbox. then i have created checkbox for the purpose to check or uncheck all checkboxes. but it neigther checks nor unchecks all here is script Untitled Document var a=0; function add(){ a++; var cedvel=document.getElementById("tab"); if(a>cedvel.rows.length){ a=cedvel.rows.length; } var a=cedvel.insertRow(a); var isare=a.insertCell(0); var solteref=a.insertCell(1); var sagteref=a.insertCell(2); var birinci=document.createElement('input'); birinci.type='checkbox'; isare.appendChild(birinci); solteref.innerHTML=a+1; var ucuncu=document.createElement('input'); ucuncu.type="text"; ucuncu.size="11"; sagteref.appendChild(ucuncu); } function del(){ var cedvel=document.getElementById("tab"); var a=cedvel.rows.length; for(i=0; i=0) cedvel.rows[i].cells[1].childNodes[0].nodeValue=i+1 } } function checkall(){ var sec=document.getElementById("tab"); for(i=0; i
onkeyup and selecting input type text value   (102 Views)
, I'm trying to access a value from an input form. I know this works without the onkeyup event but with it it says the that document.formname.elementid.value is undefined! Its extremely frustrating. As the user types into the input, I am using AJAX to generate some more options which works but I need to be able to access the input type=text value. Here is my code:
jquery selecting by id when id is "file1.jpg"   (120 Views)
i have such div: Pratesti galiojima dienai Galioja iki:2011-04-02 20:40:09 Paspausta:1 now I want to change its html content with such code: $('#file1.jpg').html('test'); and it doesn't change. Probably because he thinks that .jpg is a class. How to make him think that it is not a class but just id is file1.jpg
selecting input text data how to rerender the remaining?   (84 Views)
This is my actual code, the purpose is, when i entered a text in the text field, it gives the related suggestion, when i click a particular suggestion then rerender the remain below components, this is the situation, but here i had rerender problem. how can i solve this one, i want to rerender these components datatable,definition,tagno,ind1_def,cbpossiblevalues,ind2_def,cbpossiblevalues2", these are text fields , datatables.
Ajax selecting from MySQL   (89 Views)
everybody, I wrote a file using AJAX this is the code I wrote: File.js var http = createRequestObject(); function createRequestObject(){ var request_; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ request_ = new ActiveXObject("Microsoft.XMLHTTP"); } else{ request_ = new XMLHttpRequest(); } return request_; } function getInfo(){ http.open('get', 'GtCht.php'); http.onreadystatechange = handleInfo; http.send(null); } function handleInfo(){ if(http.readyState == 4){ var response = http.responseText; document.getElementById('ChtPlc').innerHTML= document.getElementById('ChtPlc').innerHTML + response; } } I binded that file with a function in JavaScript: So when this file selects an animated image from the MySQL database it refreshes the image automaticially each 1 second, however I want this image to stay moving until its final frame. Could you help please :-/