Re: [jQuery] search for id with '/' character

2006-10-08 Thread Mika Tuupola

On Oct 7, 2006, at 21:32, Michael Geary wrote:

 Good call. For anyone who is wondering what is valid in an ID:

 http://www.w3.org/TR/html4/types.html#type-name

Also one older document regarding the same matter:

http://devedge-temp.mozilla.org/viewsource/2001/css-underscores/

-- 
Mika Tuupola
http://www.appelsiini.net/~tuupola/



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] search for id with '/' character

2006-10-07 Thread Su
I'm curious: Why is everybody trying to fix the selector problem, 
rather than pointing out the ID is invalid in the first place?

Dexter: Get rid of the slash altogether. Problem solved.

You might be able to work around this with the various suggestions 
others have made, but if your document isn't valid before you start 
applying scripting, you've leaving the door open for future problems.



[EMAIL PROTECTED] wrote:
 Hi,
 
 if I have a form like
 
 
 
 form
 
 input type=text value=test id=content/mytest/
 
 /form
 
 
 
 How can I get the value for the input text field using jquery?
 
 I tried 
 
 
 
 script type=text/javascript
 
 
 
 $(document).ready(function(){
 
   var a = $([EMAIL PROTECTED]'content/mytest']);
 
   alert(a.val());
 
 });
 
 
 
 /script
 
 
 
 but it does not work. Thanks
 
 
 
 ___
 
 
 
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] search for id with '/' character

2006-10-07 Thread Su
Ah. Blame someone else. I see *grin*
It /is/ convenient that jQ can deal with this; I just found it strange 
no one had at least pointed it out. Workarounds are nice, but the *real* 
problem is that the HTML is just wrong, and that should be addressed 
first, if at all possible.


Ⓙⓐⓚⓔ wrote:
 I wondered the same thing,,, I wouldn't have slashes in my ids... but
 he is working with others who  have disregarded standards... It's nice
 that JQ can handle messy htmls, instead of just well formed xhtml. I
 bet xsl would just plotz!


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] search for id with '/' character

2006-10-06 Thread

Hi,

if I have a form like



form

input type=text value=test id=content/mytest/

/form



How can I get the value for the input text field using jquery?

I tried 



script type=text/javascript



$(document).ready(function(){

  var a = $([EMAIL PROTECTED]'content/mytest']);

  alert(a.val());

});



/script



but it does not work. Thanks



___



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] search for id with '/' character

2006-10-06 Thread Olivier Percebois-Garve
I guess $('input').attr('id');

[EMAIL PROTECTED] wrote:
 Hi,

 if I have a form like



 form

 input type=text value=test id=content/mytest/

 /form



 How can I get the value for the input text field using jquery?

 I tried 



 script type=text/javascript



 $(document).ready(function(){

   var a = $([EMAIL PROTECTED]'content/mytest']);

   alert(a.val());

 });



 /script



 but it does not work. Thanks



 ___



 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/

   


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] search for id with '/' character

2006-10-06 Thread Matt Grimm
Your problem is that you prefixed the input selector with #. This
works:

$('[EMAIL PROTECTED]/bar]').val();

On Fri, 2006-10-06 at 15:00 -0400, [EMAIL PROTECTED] wrote:
 Hi,
 
 if I have a form like
 
 
 
 form
 
 input type=text value=test id=content/mytest/
 
 /form
 
 
 
 How can I get the value for the input text field using jquery?
 
 I tried 
 
 
 
 script type=text/javascript
 
 
 
 $(document).ready(function(){
 
   var a = $([EMAIL PROTECTED]'content/mytest']);
 
   alert(a.val());
 
 });
 
 
 
 /script
 
 
 
 but it does not work. Thanks
 
 
 
 ___
 
 
 
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] search for id with '/' character

2006-10-06 Thread Wil Stuckey
couldn't you just do:$('#foo/bar').val();?-wilOn 10/6/06, Matt Grimm [EMAIL PROTECTED] wrote:
Your problem is that you prefixed the input selector with #. Thisworks:
$('[EMAIL PROTECTED]/bar]').val();On Fri, 2006-10-06 at 15:00 -0400, [EMAIL PROTECTED] wrote: Hi, if I have a form like
 form input type=text value=test id=content/mytest/ /form How can I get the value for the input text field using jquery?
 I tried script type=text/_javascript_ $(document).ready(function(){ var a = $([EMAIL PROTECTED]'content/mytest']);
 alert(a.val()); }); /script but it does not work. Thanks ___
 ___ jQuery mailing list discuss@jquery.com 
http://jquery.com/discuss/___jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] search for id with '/' character

2006-10-06 Thread Matt Grimm
No, that doesn't work, and I'm assuming it has something to do with the
forward slash being an XPath selector.

m.

On Fri, 2006-10-06 at 17:21 -0400, Wil Stuckey wrote:
 couldn't you just do:
 
 $('#foo/bar').val();
 
 ?
 
 -wil
 
 On 10/6/06, Matt Grimm [EMAIL PROTECTED] wrote:
 Your problem is that you prefixed the input selector with #.
 This
 works: 
 
 $('[EMAIL PROTECTED]/bar]').val();
 
 On Fri, 2006-10-06 at 15:00 -0400, [EMAIL PROTECTED] wrote:
  Hi,
 
  if I have a form like
 
 
  
  form
 
  input type=text value=test id=content/mytest/
 
  /form
 
 
 
  How can I get the value for the input text field using
 jquery? 
 
  I tried
 
 
 
  script type=text/javascript
 
 
 
  $(document).ready(function(){
 
var a = $([EMAIL PROTECTED]'content/mytest']); 
 
alert(a.val());
 
  });
 
 
 
  /script
 
 
 
  but it does not work. Thanks
 
 
 
  ___ 
 
 
 
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/
 
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] search for id with '/' character

2006-10-06 Thread Klaus Hartl


Wil Stuckey schrieb:
 couldn't you just do:
 
 $('#foo/bar').val();

No, the slash is an XPath selector. That expression translates to All 
items named bar which are a direct child of #foo, or as a CSS selector: 
#foobar.


-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/