Jump to content

want space in button value!


shahid_hussnain

Recommended Posts

hi all

here is my code...

  <?php
      echo "<input name="."button"." type="."submit"." class="."formbutton"." id="."button"." value="."Submit 1"." />";
  ?>

 

problem is, i want to display the value of button is Submit space 1 like  "Submit 1",  but it is display only "Submit" value

and blank space and 1 are not display..

 

someone help me please....

thanks

shahid hussnain

Link to comment
Share on other sites

It is simple, your code isn't producing any 'quotation marks' (look at the html source).

 

You can escape them:

<?php
echo "<input name= \"button\" type=\"submit\"  value=\"Submit 1\" />";
?>

 

or use single quotes:

 

<?php
echo "<input name= 'button' type='submit'  value='Submit 1' />";
?>

Link to comment
Share on other sites

how would you use the single quote method in strings that already have single quotes?  For example using php and javascript the following way would not work with single quotes because you already have single quotes in the string:

 

echo "<a href=\"popup.php\" onMouseOver=\"window.name='main'\" onClick=\"return popup(this, 'notes')\">Click Here</a>";

 

Any suggestions?

Link to comment
Share on other sites

Like this?:

 

echo "<a href='popup.php' onMouseOver='window.name=\'main\'' onClick='return popup(this, \'notes\')'>Click Here</a>";

 

Is this correct?

 

Or would it be like this?:

 

echo "<a href=\'popup.php\' onMouseOver=\'window.name='main'\' onClick=\'return popup(this, 'notes')\'>Click Here</a>";

Link to comment
Share on other sites

For this:

 

<a href="pwordhelp.php" onMouseOver="window.name = 'main'" onClick="return pwpopup(this, 'notes')>Click</a>

 

I tried this:

 

echo "<a href='pwordhelp.php' onMouseOver='window.name = \'main\' ' onClick='return pwpopup(this, \'notes\')'>Click</a>";

 

and this:

 

echo "<a href=\'pwordhelp.php\' onMouseOver=\'window.name = 'main'\' onClick=\'return pwpopup(this, 'notes')\'>Click</a>";

 

neither of them worked... oh well, guess I'm sticking with double quotes :-)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.