I have been trying to figure this out for a while, and I cant manage to get it working. I have a table for instance the one below:
<tr>
<td><input type='text' id='test_value[]' .... /></td>
<td><input type='text' id='test_value2[]' .... /></td>
<td><input type='text' id='date[]' onclick ="testfunc(this);" .... /></td>
</tr>
Within my function I can grab the index of the onclick no problem, but when I select the date from the date picker, it always select the first column.
testfunc(val)
val.parentNode.parentNode.rowIndex
I am using clone to create multiple instances of a row, but how can I use non-unique id (date[]) which all my X rows have the same name, to unique enter the datepicker value.
When dialog pops up and when I want to select date from datepicker but clicking on input datepicker is under dialog. What option make it to be on top ?
I am trying to loop through my top level nav i.e <ul> <li> and then apply that class name to teh sub level menu of that particular top level. So essentially the clas name on the top <li> wil be applied to its sub level items. Here is my code, which isn't working at the moment:
$(document).ready(function(){ var pageID = $('body').attr('id'); var uniquePageID uniquePageID =$("#site-nav ul li",this).attr('id');
I am using MVC3 with razor and binding dropdownlist with a listNow issue is @Html.DropDownListFor(model => model.Result, new SelectList(Model.Result.OrderBy(item => item.Enhet), "EnhetID", "Enhet"), "ALL")in Enhet i am getting 3 values Nitin NA NAI want to make sure that values are always unique, how can i remove duplicate values.
I'm interested in getting an array of unique class names of all option tags under a specific select element. I'm imagining something like this (which does not do what I want): $ ( '#select_id option.class' ); What's the correct way to do this using jQuery?
I'm just learning jquery an have an issue. I have a page, product.php, that is set up with unique urls depending on the product clicked. So, product.php?id=15, but in my PHP code, because I'm pulling from my database, it appears as product.php?id=$id. I am trying to get jquery to load that page, but with the unique id.
Let's say you have two elements, and you know their IDs; is there a way to select them both at the same time; something like $('#test #test2')?I realize I could just select them both on two different lines and apply the same function, or use class or something to track them down; but sometimes I just want to grab two elements by ID and do the same thing to them. I assume I'm just missing the syntax.
My problem is that im using jQuery to replace the bb tags in a message. I want to replace all the [youtube][/youtube] with a youtube video and so far it works only if there is only 1 [youtube][/youtube] tag. If there is multiple [youtube][/youtube] tags in a message they change all of them to the same video.[code]
I see that the cluetip plugin project is on github so, perhaps at some point I'll be able to try implementing this feature myself, and submit a pull request. My team is using the cluetip plugin in a rather exceptional way. Rather than a tooltip like msg bubble that appears on mouseover, we show the cluetip on page load and require the user to dismiss it. We're using these cluetips to communicate new features on our site. After looking at available jquery plugins, cluetip seemed to be best suited for this use (all be it, a rather exceptional use).
The current design allows for this use with just a bit of css work but it limits us to one cluetip visible on a page at a time. Multiple cluetips are not possible because the cluetip div container has a non-unique id and the jquery id selector is used in the plugin code (which means that only the first cluetip in the DOM is ever referenced by the code). I'd like to extend the code to allow for dynamic assignment of the id on the cluetip container which would allow us to render multiple cluetips on the page. Perhaps, this might constitute a new plugin, since this isn't really the intended use of cluetips.
The indentation is probably a little wacky, since I just copy/pasted, but that's what I've got right now. When you click on .postTags_opener, it shows the nearest matched .postTags; that is exactly what I want, since .postTags immediately follows a .postTags_opener. The problem arises when I then try to close it: .postTags_closer comes after .postTags starts, so that's probably why next() is bugging out.
These DIVS are full of information populated from a MSQL db. So the DIV names cannot be unique. I have this jQuery code:
[Code]....
This code actually works perfectly except for one major headache. When I click the 'hide/show' link on any of these - the only one that hides or shows is the first set. After research I feel like I'll need to use the .parent() selector or (this) somewhere but I feel like I've tried every combination.
Im building a small feature where users can create a page. They select an element they would like to add from a select box. When they select it it is automatically appended into the preview div. The problem is that they can choose to add any number of divs, p,s etc to this preview div and i need a way of giving them all unique ids so i can use them later.
I have a sharepoint site which I am integrating into and I wrote a hundreds of custom functions on my HTML demoin oldschool plain javascript based on the Unique IDs of the elements, however sharepoint 2007/or ASP.NET seems toprepend unique IDS with a long string of crap, the string of crap ('which I shall now refer to as the crapstring') changes based on which page you are on ("eg txtNameValue becomes zctl00_ctl16_g_b132ca0b_b2ad_4e2b_a5e0_8babbb67ff22_ctl00_txtNameValue'"). I found a piece of code in oldschool javascript which works on a page by page basis however I need something I can include in the header that performs the same function across all pages. I was thinking of something in Jquery that works on id*=
I'm trying to parse my anchor tags, by getting all the href attribute available in the page, and then i will loop through this attribute values and then parse it. if each href value is equal to "mypage.com", the link will open to the same window, but if not it will open to a new window, more like the concept of determining internal and external links in a page.
Are there limitation on what can be set for css styles? I have a script which sets a unique id but I wanted to turn user-select off for that item. I thought this would work: var id = 'wrapper_' +(new Date().getTime()); var wrapper = $('<div id='+id+'></div>' ); $(id).css({'-webkit-user-select: none;'});
The error I get is: Uncaught SyntaxError: Unexpected token }
I have a page with 641 images in it. Each image can be clicked with as result that the image source will be changed. For this the images need to have a unique ID. But to do this manually for 641 is just too much. Is there a way to give each image his own unique id without setting them myself?
i have an array and i don't know the content of it, but i want only unique values. in php there is a function to do this, but how must i do this in javascript?
This all works correctly but does not validate.I need to use unique id's for each name.The easiest way (as each checkbox html is generated by php) is to append the value to the id i.e.
<script language="JavaScript"> // Unique Random Numbers Picker // By Premshree Pillai
var numArr = new Array("0","1","2","3","4","5","6","7","8","9"); // Add elements here var pickArr = new Array(); // The array that will be formed var count=0; var doFlag=false; var iterations=0;
This script is a slightly modified version of "Unique Random Numbers". In this script it becomes easier to implement more than one instances of "Picking Unique Random Numbers".
This JavaScript picks up a number of unique random elements from an array.
For example; if you have an array myArray consisting of 10 elements and want to pick 5 unique random elements. Suppose initially myArray[3] is picked randomly, then myArray[3] should not be picked again.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Unique Random Numbers II</title> <!--BEGIN HEAD SECTION CODE--> <script language="JavaScript"> // Unique Random Numbers II // -Picks a number of unique random numbers from an array // By Premshree Pillai // http://www.qiksearch.com, http://javascript.qik.cjb.net
function pickNums(nums, numArr, pickArr, count, doFlag, iterations) { iterations+=1; var currNum = Math.round((numArr.length-1)*Math.random()); if(count!=0) { for(var i=0; i<pickArr.length; i++) { if(numArr[currNum]==pickArr[i]) { doFlag=true; break; } } } if(!doFlag) { pickArr[count]=numArr[currNum]; document.write('<b>' + numArr[currNum] + '</b> <font color="#808080">|</font> '); /* Modify above line for a different format output */ count+=1; } if(iterations<(numArr.length*3)) // Compare for max iterations you want { if((count<nums)) { pickNums(nums, numArr, pickArr, count, doFlag, iterations); } } else { location.reload(); } } </script> </head> <!--END HEAD SECTION CODE--> <body bgcolor="#FFFFFF">
<!--BEGIN BODY SECTION CODE--> <script language="JavaScript"> var numArr1 = new Array("0","1","2","3","4","5","6","7","8","9"); // Add elements here var pickArr1 = new Array(); // The array that will be formed var count1=0; var doFlag1=false; var iterations1=0;
pickNums(5, numArr1, pickArr1, count1, doFlag1, iterations1); // Call the function, the argument is the number of elements you want to pick. // Here we pick 5 unique random numbers </script> <!--END BODY SECTION CODE-->
I need a script that will generate a unique ID consecutive to the previous one when a user submits a form. For example, I submit the form and the confirmation page shows:
JGH100354101
I will need the next user that submits the form to have the confirmation page show:
JGH100354102
and so on and so on...
Is anyone aware of a simple form script that would accomplish this?
I have updated my website with Ajax code. How should I get unique url after click on menu. I mean if I click on "about me" on my website yogawithgauri.com. the url in the address bar should be [URL]