Jump to content
Larry Ullman's Book Forums
Marie

Changing Size Of Text Fields

Recommended Posts

Well, I was thinking that if you hired someone like Stuart, he could moderate the forums as well as be a technical editor for your books, etc., etc.

 

Anyway, I'll drop it.

Share this post


Link to post
Share on other sites

Well, money aside, and what I could or could not afford, the first problem would be who to hire. Stuart would be great, sure, but so would many other people, including people in the past who aren't currently frequenting the forum. So making that choice would be tough and, more importantly, I'd run the risk of offending and/or driving off the other people that are helping. It means a lot to me that people, like yourself, help others here, but I think it's best done voluntarily.

 

Second, if I were to pay someone to moderate the forums, I'd need to oversee them and I'd have certain expectations. If someone handles something poorly now, that's largely on them. If someone I'm paying handles something poorly, that's largely on me.

 

Third, paying someone to moderate the forums becomes a disincentive for me to participate in the forums. And part of the point of the forums is that readers can get help from the writer here.

 

Technical editors are paid by the publisher. And they need to be top-level experts on the particular subject (meaning the same person wouldn't be the tech editor on multiple books).

 

There are certainly aspects of my job that could be managed by a paid assistant, but I'm not at a point yet where that's financially appropriate and I'd have to think more about what I need before pursuing that further.

Share this post


Link to post
Share on other sites

No need to apologize and you certainly didn't offend me. But, yes, I had thought this through and I hadn't discarded the idea without due consideration.

Share this post


Link to post
Share on other sites

Hello All,

 

Sorry for not getting back to this post. I gave up on it and got sidetracked on something else. SO, I have not change the size of the visual or width as of yet but understand that this should be CSS. It makes sense. However, I still do not see it in any of the files that I have downloaded for the Knowledge is Power website. I seem to remember something in the book that says it is set to the browser default.

 

This is the kind of code I am used to seeing - <input type="text" name="MiddleName" id="MiddleName" size="40" /> So the size - "40" could be "58" "100" or whatever and it would give the user more space to see their input. Personally I do not like to input something into a form that doesn't let you see the whole email address or name or street address.

 

Thanks,

Marie

Share this post


Link to post
Share on other sites

Marie,

I will try to help you, even though I expect this will bring forth a flurry of replies saying what I am telling you is wrong. You decide for yourself.

 

In my first post to your question, I told you how to do this, giving example of my own code.

 

Someone else said 'use CSS' and later someone gave an actual example. Probably you didn't notice that because maybe like me, I expected CSS to be in a separate file, but of course it doesn't have to be. It is right in with the HTML. Look closely and you will see it.

 

So you can try either of these methods and see how they work for you. I have never done this with CSS (other things I do with CSS but not forms) so I can't say anything about if that will work for you or not.

 

I might suggest that you use my method and then if that works for you, you can then modify that to use CSS to make it the way it 'should be'.

 

Share this post


Link to post
Share on other sites

Thank you everyone for your comments,

 

Abigail -

 

I threw in your code on the "last name" field of the Registration Form and this is how that code appeared.

 

<p><label for="last_name"><b>Last Name:</b> <input type="text" name="last_name" size="20" maxlength="40" value="<?php echo $ln; ?>" /></p><?php create_form_input('last_name', 'text', $reg_errors); ?></p>

 

When I checked it out I got an undefined variable error - In

 

So, I know I could rework this to make it work. I tried this several times before my original post but the length was always the same as if something was overriding any code that I put into the form.

 

I can see that entering this kind of code in a CSS file would be better since then one would not have to change this on each page where it would appear.

 

However, I still don't see anything where the original "size" or Display Length appear so if the browser's default takes care of this, then I suppose that a person does not have to do anything. Sorry, if it is there, then I am missing it.

 

Don't mean to keep harping on a "point" but just want to learn PHP, etc. inside and out so I do not keep getting these bumps in my web site.

 

Marie

Share this post


Link to post
Share on other sites

I'm pretty sure early on I showed you the line of css code you need to change to adjust the physical width of the textarea or input (I can't remember exactly and my phone is slow). You can use either HTML as suggested or CSS to achieve the same result, but I do feel that CSS is the more accepted method. However, you should focus on just trying to get the form to display however you want it to visually appear at the moment, so I would leave out the php for the moment as that is causing you some kind of error. Also have you looked into using firefox and the web developer extension?? It is extremely helpful for situations like this, where you have CSS code that you haven't written as it tells you the html element and path through the document to that element along with the associated CSS and also allows you to edit the CSS in the browser. No messing around, then you know where to start with yo adjustments.

Share this post


Link to post
Share on other sites

The reason you are having trouble is you are trying to combine HTML with create_form_input(). Please post your code that is close to what you want and say what change you want to make. Otherwise, we are answering the wrong question.

 

 

Share this post


Link to post
Share on other sites

Hello all,

 

I believe that I have finally figured this out - at least the route that I would like to take. All of your suggestions would have worked, I am sure, however, I started reading chapter 4 again and discovered what I was looking for on page 73.

 

Personally I work on a MacBook Pro so I don't get into IE at all.

 

Anyway, I changed the code on the form_functions.inc.php page to the following —

 

// Start creating the input:

echo '<input type="' . $type . '" name="' . $name . '" id="' . $name . '" size="' . "40" . '"';

 

You will notice that I added a size to the form inputs. Now it seems that on every page where there are form fields they are all uniformly longer on each page and I only had to change that one include page.

 

Okay, now on to other problems.

 

Marie

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...