JQuery :: Referencing Drupal Form API Description Fields?
Aug 2, 2011
I'm trying to create tooltips for a Drupal form that was built with the Form API. I'm able to show and hide all of the description fields on the form using the following method
I am using the following system to create my forms : <% using (Html.BeginForm()) { %> Now I want to refer to the form in JQuery, but all the examples I can find refer to the form by it's name. How do I refer to my form if it doesn't have a name?
There are two input fields in a form, but only one of them is required, they are not required at the same time. Either A or B is required. ( A is required OR B is required). In other words, a user can input data to field A, or he can input data to filed B, but he can not input data to Both A and B at the same time. How to implement this constraint in Jquery form validation?
whenever I run the below code I am unable to hide my <DIV>. I have posted a previous post regarding hiding DIVs however as this is slightly different I thought I would create a new topic here to allow for easier searching for other users.
The below code works if the DIV is outside of the form however if I enter it within the form nothing happens.
I have a number of Jquery plugins being called through my Drupal Acquia Marina theme .info file. They work fine in all popular browsers with the exception of IE6 and IE7, in which they don't appear to load at allSome of the plugins are very basic, like the following slidetoggle, which like all of them, exists as a a .js file referenced in a .info script call - $(document).ready(function()
I'm trying to have JQUERY slider on one of my contents (story). I installed jquery_ui (replaced with jquery ui 1.7), jquery update and all the things neede (no red warnings about things to do with jquery - everything working fine). I made new story, set input format to "PHP code" and pasted following short code:"...Testing jQUERY slider
i have a simple thing that causes me all sorts of headaches. I have many forms on the same page, and identical items in each form. The same object in each form call the same procedure. So, I'm passing in the form value, such as:
onchange="DoMyFunction('formName');" and then in the procedure i do: function DoMyFunction(formname){ document.[formname].object.value='1'; }
Now i have functions like this all over, problem is getting them to work. Once they work, they work fine. But when i add a new one, it can match an old function (except the object being referenced) and it won't work!
Does anyone know the proper way to reference a form in a function?
I have validation code on my web form used by passing in the name of a field on the form. I have fields on my form named Hospital1, Hospital2, Hospital3, etc. I am trying to write a For loop to validate each one:
with (thisform) { {for (i=1; i<=9; i++) {
[Code]....
What is the proper format of var vHosp= "Hospital"+i; so that it will recognize that field?
I'm currently having difficulty to debug this issue in ie7. When the page is loading, all carousel lists are exposed and content displays for a couple of seconds.
I am experience some problems reading a form variable from a Javascript function. The point with this particular variable is that its name has the following syntax:
<input name="tx_impexp[tt_content:159]"/>
I want to set this var to 1 from my javascript function, so I tried to execute the following line of code:
Error: missing ] in index expression document.frm_1.tx_impexp[exclude][tt_content:159].value=1 --------------------------------------------------------------|
It seems Javascript expects to close down the bracket at the position marked...An easy solution would be to change my var syntax but the point is that I cannot since I am using an already made script and I should not modify it.
Just wandering if this is due to a syntax error defined according to Javascript specification language or there is something wrong with this.
I have next url for you to look [URL] i want the blue bar to contain an other image for 'some' pages... the action should be performed on the click of the menu items of my drupal site.
I was thinking that this would be easy with jQuery but the problem is thatjQuery isaclientside action and when the link is clicked its a server side request response and the image should stay the same... is this a little clear ...?
I have been looking for the past 2 days for a script that I can add and delete table rows.
I have found a lot but so far all of them add an input field but I desperatly need a textarea or ideally a section of input fields.
I have tried to change the code from input to text area but none of them worked.
Have you come across to a similar script.
I would appreciate any contributions.
What I am trying to do is a page where the user will add their employees details so we can order business cards for them. So I have fileds such as, Name, Tel Num, Email, Cell etc.
I have this order form where the customers can change the quantity by intput in a text field.I would like to have the text field changed with select fields, but doing so in the form, the script is not doing anymore.Can anyone have a look and tell me what to change in the scritp to accept select fields in place of the text fields.
We're using Malsup's form plugin v2.82 and jQuery core 1.6.2. We're having issues in IE7 where, on a form with file upload, form fields are being dropped before the form is submitted to the server.We tracked it down to the `fileUpload` function, specifically line 196 where each field in the form data has `.attr('disabled',false)` run against it. If we change this to`.prop('disabled',false)` it all works fine.I don't see a clearly marked place to submit bug reports for the form plugin, and wanted to verify that others see this as well,
I have a form that has a reset button, and when it's closed, the form is reset. However, at least in testing on my own machine, I notice that the form fields are remembering past input (on Firefox 4 anyway). Once this goes public, I don't want the form remembering anything in case the website is viewed on a public machine. How can I keep the form fields from remembering any past input?
I am re-developing my website and want to use some Ajax/jQuery in it (so I am learning as I go) and I am not sure if this is possible so that is my first question:I have a registration form and I would like to know if after the person registering has completed their first and surname and the 2 sections of their postcode if I can use jQuery to run a PHP script to see if they are already registered before waiting for the form to be submitted and running a script then.I am thinking onkeyup (or similar) after the last field is completed but I don't know how that would work needing to also use 3 other field values.If this is possible, can anyone give me any ideas of examples that do this or how I can go about passing all the variables and running the scripts at the correct time.
This has really got me stuck. Below is a distillation of my problem:
This is my function:
function Clear(form) { ???.checked = false; } <form name="myform">
[Code]....
How do I execute the function to clear the checkbox the moment it is clicked? How do I reference that specific checkbox, when there are multiple checkboxes with the same "name"?
The rules (the above is a simplified version of my actual problem. There is much more to my script, which means other possible solutions cannot be considered):
1. I am aware of onclick="this.checked=false", but I cannot use it.
2. The ID for the checkbox is dynamically generated, whereas the entire onclick command must be the same for all checkboxes.
3. All checkboxes must have the same name, and the name must have square brackets.
4. "this.form" must be in the onClick, as it is used by the rest of the function.
I'll try and keep this as short as possible (honest), scenario is this... I have a "price comparison" website which looks for deals via a php? query string url and returns the results as an Iframe inserted into a static "show" template page. Unfortunately that gives me 1000+ pages with duplicate title and meta descriptions...
What I'm trying to do is grab (server-side, from returned iframe content) a certain element of text (e.g. first (b)text to change/insert title and use the same text to insert in front of my description (i.e. description="grabbed text" blah blah blah
I know basic html and css etc and have started reading up on Jquery, but thats it... I'm not a programmer, so having asked question on a couple of forums and "googled" relevant topics, I've only got confusing info... most pointing towards Jquery, ajax etc. Thing is everyone goes "tech-speak" on me, might as well be martian...
I am building a site to replicate an existing site for a non-profit.[URL] want to have a rotating image on their home page, and I have it working using the following jQuery Code:
The problem is that I can't figure out how to clear the previous slide's decription (in the <p> tag of each Div). At present the descriptions do rotate, but they are all visible since they are within the stacked Div's. How can I get the descriptions to show and hide in sync with the images?
The site I am working on has a few forms that allow the user to add new form fields (textbox, textarea, etc.) dynamically. I am using a structure smiler to: <form> <label>Name : </label> <input type = "text" / > <label>Age : </label> <input type = "text" /> <span id = "add_field"> Add Field </span> </form>
<script type = "text/javascript"> $(function(){ //create a new field then append it before the add field button $("#add_field").click(function(){ var new_field = " <label>Name : </label> <input type = "text" / >"; new_field+="<label>Age : </label> <input type = "text" />"; $(this).before(new_field); });});
As you can see I create the field using javascript and just insert it before the add field button. However I have seen lots of other sites have a smiler sort of function but they seem to make an ajax call for the field as they use a loading-type animation during the few seconds it takes for the field to be added. My questions are : Which is a better way of doing this type of thing? And why is one better than the other? If it is better to create the field client-side should I change how I am doing it? Instead of creating a string representing html and appending it should I be doing it a different way?
I'm a jQuery newbie. I'm trying to use the "link" plugin without much success. I've been trying to find a simple example but can't seem to find it. I have a form with address fields and matching billing address fields. I would like to link between the fields. I tried something like the following but it doesn't work:
I have an OL with several LI elements. When each LI is clicked their html is replaced with a full form (multiple input types, submit button, etc). This form information is being populated from a php page using ajax.
The problem I'm running into is each time I click a form input jQuery thinks I'm clicking the LI element, which causes the ajax to fire, refreshing the form info. Essentially making it behave as if I had just lost focus.
I'm fairly new to jQuery and JavaScript. I've beat around the block a couple times modifying code from here and there, but never written anything myself. Just thought I'd warn you.I'm writing a tidbit of code that is going to be used for a photographer's website. The concept of the site is very simple; I am going to have Drupal generating two lists. The first list is simply photographs, semantically they just come one after another. The second is a list of div tags that contain a description of the photographs.The only way that the imagescorrelatecurrently is their semantic order. The first image should be matched with the first description, the second image with the second description, and so on. I do plan on changing this, but for the time being it is not my main concern.
Because the number of images added to the page might not necessarily be limited, I need to have jQuery pair up the images with the proper description, and then display it on hover—dynamically. My current method requires me to write out each hover functionindividually.This is a problem because, as I have mentioned, the amount of photos on any given page should not be limited.Currently I have the functionality that I want, with the exception of the dynamic creation of functions. You can view what I have managed to do so far athttp://calvintennant.ca/blakeley.me/mock.htm.I have attached a .zip with all the files used to create that mock-up.
I have few input box, selector and submition button in my form can I use adescription on mouse hover likethis example. The example for the links I tried to dosomemodificationbut unable to do any effect like the example page. So, I want to know can I do like this?