Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 12, 2012 04:18 PM by me_ritz
Member
50 Points
254 Posts
Dec 12, 2012 03:55 PM|LINK
Hi!
$('#libraryManagementSection').find('input[type=text]').width("185"); $('#librarySearchSection').find('input[type=text]').width("185");
I have used the id field of the <div> and changed the width of all the text boxes with in that div section like above.
Is there a better was of doing this. I have about 10 screens which implement this.
could I put the width "185" in a common place and use it like above?
Thank you,
urpalshu
Participant
1483 Points
330 Posts
Dec 12, 2012 04:06 PM|LINK
to all divs, wherever you want this, give them a common class e.g. "width185" and write this code in any master/common js file..it will apply width to all textbox inside all divs with class "width185".
<div id="..." class="width185" ></div> $(".width185 input[type=text]").css('width','185px');
Star
9337 Points
1447 Posts
Dec 12, 2012 04:18 PM|LINK
urpalshu Is there a better was of doing this. I have about 10 screens which implement this.
This is why CSS is there.... you dont necessarily need JQuery to do this...
<style type="text/css"> div input[type=text] { width:185px;} </style>
this applies to every textbox inside any div.
<style type="text/css"> .divContainer input[type=text] { width:185px;} </style>
this applies to every textbox inside div with class = 'divContainer'
Put the desired css in a stylesheet file and refer it to the pages...or you might consider asp themes
urpalshu
Member
50 Points
254 Posts
better way to change the width of text area
Dec 12, 2012 03:55 PM|LINK
Hi!
$('#libraryManagementSection').find('input[type=text]').width("185");
$('#librarySearchSection').find('input[type=text]').width("185");
I have used the id field of the <div> and changed the width of all the text boxes with in that div section like above.
Is there a better was of doing this. I have about 10 screens which implement this.
could I put the width "185" in a common place and use it like above?
Thank you,
urpalshu
pratik_galor...
Participant
1483 Points
330 Posts
Re: better way to change the width of text area
Dec 12, 2012 04:06 PM|LINK
to all divs, wherever you want this, give them a common class e.g. "width185" and write this code in any master/common js file..it will apply width to all textbox inside all divs with class "width185".
<div id="..." class="width185" ></div> $(".width185 input[type=text]").css('width','185px');Software Engineer,
iGATE Global Solutions.
pratik_galoria@yahoo.co.in
+91-8905195943
me_ritz
Star
9337 Points
1447 Posts
Re: better way to change the width of text area
Dec 12, 2012 04:18 PM|LINK
This is why CSS is there.... you dont necessarily need JQuery to do this...
<style type="text/css"> div input[type=text] { width:185px;} </style>this applies to every textbox inside any div.
<style type="text/css"> .divContainer input[type=text] { width:185px;} </style>this applies to every textbox inside div with class = 'divContainer'
Put the desired css in a stylesheet file and refer it to the pages...or you might consider asp themes