[Dojo-interest] label for tag breaks up with dojo

Pedro Meza Herrera pmeza at mafufo.com
Fri Apr 7 11:24:29 MDT 2006


That did the job!! Thanks!

But also, dojo shouldnt remove those IDs as what if I had an event that 
extracts the INPUTs data to send them to a database.
The ID its needed to reference the data of the correct input.
The other way to access the value would be to use a Slower for loop:

function goFetch(id,name) {
        var go=getElementById(id);
        if(id==null) return null;
        l=go.lenght;
        for(x=0;x<l;x++,v=go[x])
        {
            if(v.parent.id==id) return v;
        }
    }

Jon Sykes wrote:
> So you could for example make that:
>
> // strip IDs to prevent dupes. removeAttribute() doesnt care if 
> attribute doesnt exist
> if (baseNode.tagName != "INPUT" && baseNode.tagName != "TEXTAREA") 
> baseNode.removeAttribute('id');
>
> Just to cover your input and textarea with labels issues.
>
> But it doesn't really address the larger issue that ID's get stripped 
> (and probably rightly so).
>
> Maybe there need to be some way of "linking" labels with inputs on the 
> fly with guaranteed unique naming conventions.
>
>
> Jon
>
> On Apr 6, 2006, at 11:22 PM, Jon Sykes wrote:
>
>> DOMWidget,js
>>
>> 200 // strip IDs to prevent dupes. removeAttribute() doesnt care if 
>> attribute doesnt exist
>> 201 baseNode.removeAttribute('id');
>>
>>
>> if you comment out 201 it'll work.
>>
>> Anyone know if there's a back door way of turning this off?  Any 
>> widget that interacts with a form element is going to strip essential 
>> functionality if it removes the ID.
>>
>> Thoughts?
>>
>>
>> Jon Sykes
>>
>>
>> On Apr 6, 2006, at 10:50 PM, Jon Sykes wrote:
>>
>>> Interesting.  bnecuase Validate.js has two templates, that I could find:
>>>
>>> templateString:   "<div>"
>>> +   "<input dojoAttachPoint='textbox' 
>>> dojoAttachEvent='onblur;onfocus;onkeyup'"
>>> +     " id='${this.id}' name='${this.name}' "
>>> +     " value='${this.value}' class='${this.className}'></input>"
>>> +   "<span dojoAttachPoint='invalidSpan' 
>>> class='invalid'>${this.invalidMessage}</span>"
>>> +   "<span dojoAttachPoint='missingSpan' 
>>> class='missing'>${this.missingMessage}</span>"
>>> + "</div>",
>>>
>>>
>>> and...
>>>
>>>
>>> templateString: "<input dojoAttachPoint='textbox' 
>>> dojoAttachEvent='onblur;onfocus'"
>>> + " id='${this.id}' name='${this.name}' "
>>> + " value='${this.value}' class='${this.className}'></input>",
>>>
>>> both of which should rewrite the id back into the input.
>>>
>>> hmmm?
>>>
>>>
>>> Jon Sykes
>>>
>>>
>>> On Apr 6, 2006, at 10:26 PM, Pedro Meza Herrera wrote:
>>>
>>>>
>>>> Dojo Converted it into:
>>>>
>>>> <label for="firstname">First Namelabel>			
>>>> <div>
>>>> 	<input style="background-color: rgb(204, 255, 204);" 
>>>> 		dojoattachpoint="textbox" 
>>>> 		dojoattachevent="onblur;onfocus;onkeyup" 
>>>> 		name="firstname" 
>>>> 		value="" 
>>>> 		class="medium">
>>>> 	<span style="display: none;" dojoattachpoint="invalidSpan" class="invalid">
>>>> 	* The value entered is not valid.span>
>>>> 	<span style="display: none;" dojoattachpoint="missingSpan" class="missing">
>>>> 	* required field.span>
>>>> div>
>>>> 		
>>>>         
>>>> The ID of the INPUT is gone!.
>>>>
>>>> BTW, im using dojo nightly 02-Apr-2006
>>>>
>>>> Jon Sykes wrote:
>>>>> What does the rendered HTML for the below tag look like after 
>>>>> Dojo's done it's magic !
>>>>>
>>>>>
>>>>> Jon Sykes
>>>>>
>>>>>
>>>>> On Apr 6, 2006, at 9:53 PM, Pedro Meza Herrera wrote:
>>>>>
>>>>>> haaaalp!!!
>>>>>>
>>>>>> Pedro Meza Herrera wrote:
>>>>>>> hello
>>>>>>>
>>>>>>> Im new to dojo and have a question.
>>>>>>> Im making an already working website to dojo and have some HTML 
>>>>>>> tag problem.
>>>>>>>
>>>>>>> When I change an Input field to be dojo-validated, the "label 
>>>>>>> for" tag stops pointing to the input field.
>>>>>>> Without dojo, when I click on the label text on the webpage, It 
>>>>>>> moves the cursor to the associated input field, but with Dojo, 
>>>>>>> the cursor disappears.
>>>>>>>
>>>>>>>             <label for="firstname">First Name:</label>
>>>>>>>            
>>>>>>>                 <input type="text" name="firstname" 
>>>>>>> id="firstname" value="" class="medium"
>>>>>>>                     dojoType="ValidationTextbox"
>>>>>>>                     trim="true"
>>>>>>>                     ucfirst="true"
>>>>>>>                     required="true"
>>>>>>>                     missingMessage="* required field."/>
>>>>>>>
>>>>>>> Other than that, Dojo is great!
>>>>>>>
>>>>>>> Cheers
>>>>>>> ------------------------------------------------------------------------
>>>>>>> _______________________________________________
>>>>>>> Dojo FAQ: http://dojo.jot.com/FAQ
>>>>>>> Dojo-interest at dojotoolkit.org
>>>>>>> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>>>>>>>   
>>>>>> _______________________________________________
>>>>>> Dojo FAQ: http://dojo.jot.com/FAQ
>>>>>> Dojo-interest at dojotoolkit.org <mailto:Dojo-interest at dojotoolkit.org>
>>>>>> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>>>>>
>>>>> ------------------------------------------------------------------------
>>>>> _______________________________________________
>>>>> Dojo FAQ: http://dojo.jot.com/FAQ
>>>>> Dojo-interest at dojotoolkit.org
>>>>> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>>>>>   
>>>> _______________________________________________
>>>> Dojo FAQ: http://dojo.jot.com/FAQ
>>>> Dojo-interest at dojotoolkit.org <mailto:Dojo-interest at dojotoolkit.org>
>>>> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>>>
>>> _______________________________________________
>>> Dojo FAQ: http://dojo.jot.com/FAQ
>>> Dojo-interest at dojotoolkit.org <mailto:Dojo-interest at dojotoolkit.org>
>>> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>>
>> _______________________________________________
>> Dojo FAQ: http://dojo.jot.com/FAQ
>> Dojo-interest at dojotoolkit.org <mailto:Dojo-interest at dojotoolkit.org>
>> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Dojo FAQ: http://dojo.jot.com/FAQ
> Dojo-interest at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mastodon.dojotoolkit.org/pipermail/dojo-interest/attachments/20060407/5eba5513/attachment.html


More information about the Dojo-interest mailing list