make dynamically generated button text bold

Hi how can I make this part of the code bold. I tried strong. tags but they just printed into the button.


from this php page code

<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
    <td width="6" height="42" background=""></td>

    <td background="">

        <input name="search" type="textfield" style="width:130px;" value="<?php echo $_COOKIE['term'] ; ?>">

        <input type="submit" name="submit" value="Search in <?=$displayOnlyInCat?> Category" >

        <input type="hidden" name="cat" value="<?=$onlyInCat?>"><input type="hidden" name="all" value="no"></td>

    <td width="6" height="42" background=""></td>

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

<input type="submit" name="submit" value="Search in <?=$displayOnlyInCat?> Category" style="font-weight:bold; ";>

macuser777Author Commented:

But I only want


part in bold
and this has failed ?
<input type="submit" name="submit" value="Search in<b><?=$displayOnlyInCat?></b> Category">
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

I don't think you can do that using only an <input> tag.

Try using a blank value in the <input> tag. Then setup a <div> tag on top of the botton with the text formatted in the way you need it. You would need javascript to submit the form after the onclick event on top of the <div> tag.
Sound ugly, but this is the first thing I could think of.
here are a couple of different ways from here in EE
function ChangeFont(size)
<div align="center">
<p><br><span style="font-family: Times New Roman; font-size: 16px;" id="text2">Page Header</span></p>
<input type="button" value="Change It" onClick="ChangeFont('11px');">


<span id="text2" style="font-family: Times New Roman; font-size: 16px;">Page Header</span>
<input type="button" value="Bold" onClick="document.getElementById('text2').style.fontWeight = 'bold'">
<input type="button" value="Italic" onClick="document.getElementById('text2').style.fontStyle = 'italic'">

good luck.
macuser777Author Commented:
>>>>><input type="submit" name="submit" value="Search in<b><?=$displayOnlyInCat?></b> Category">

yeah - tried that , and <strong> tags as well. Just prints into input button like text.

>>>good luck.

you're not kidding! :)

Javascript ??? - hmmmm....i'll have to save up some more points I think.....:)

and...may be being dense...but can't see how that would just bold <?=$displayOnlyInCat?> and not all text in button......

hmmmm...maybe if I make static images of static text and put them next to bolded button with dynamic text.....hmmm dunno...i'll let you know

It's a small thing ... but it would make navigation clearer
how about try something like this.
<input type="submit" name="submit" value="Search in'<b>'<?=$displayOnlyInCat?>'</b>' Category">

I am not really sure about the placement of the single ticks. but I am thinking it might work i know in jsp you can use single ticks to add code to tags. just a thought might not work but if it did it would be a great simple solution.
macuser777Author Commented:
Unfortunately not. That printed into button as text as well.
<button type="submit" name="submit">Search in <b><?$displayOnlyInCat?></b></button>
(May not work in all old browsers)
macuser777Author Commented:
Tried it in Mozilla and safari. It leaves out the dynamic part of button text altogether. Button just says 'search in'

Oops, forgot the = sign.
 <button type="submit" name="submit">Search in <b><?=$displayOnlyInCat?></b></button>


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It would be easier to create a gif, that looks like input button, then have the text dynamically overlay the image, and have the image dynamically expand to fit the text.

But I suggest considering just how important just that text is to be bold?

Good Luck

Ah I scrolled through all of that and pow, stormywaters has the answer !  And as he pointed out, yes, not all older browsers support <button>.
macuser777Author Commented:
>>>><button type="submit" name="submit">Search in <b><?=$displayOnlyInCat?></b></button>


StormyWaters, it works like a charm in mozilla based, IE for Mac, Opera and Netscape on my mac.

In safari it bolds in the right place but changes the button style from the Mac default Aqua type to something more like a windows IE button. That's was ok, but it also in safari  it then put the button on a new line. Dealt with that by using

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.