Jump to content

html form using \" or ' ?


unistake

Recommended Posts

Hi all,

I have a bit of a problem getting a code to work. The code I have is part of a calculator which works great in a .html page however when I put it in to echo "the calculator"; the outcome never happens.

 

I suspect I have gone wrong by replacing all the " with ' instead of using \" somewhere along the way.

The code I am trying to get working is:

 

<?php

echo  " <form name='calcform'>
  <label>
  <input name='box1' type='text' id='num' value='4'>
  </label>
  <label>
  <input type='radio' name='radio' id='radio' onClick='calculator('qualifier', 'result');'>
  qualifer
  </label>";

?>

 

Thanks :)

Link to comment
Share on other sites

Try:

 

<?php
echo "<form name='calcform'>\n"; 
echo "<label>\n"; 
echo "<input name='box1' type='text' id='num' value='4'>\n"; 
echo "</label>\n"; 
echo "<label>\n"; 
echo "<input type='radio' name='radio' id='radio' onClick='calculator('qualifier', 'result');'>\n"; 
echo "qualifer\n"; 
echo "</label>\n";
?>

Link to comment
Share on other sites

Hi all,

I have a bit of a problem getting a code to work. The code I have is part of a calculator which works great in a .html page however when I put it in to echo "the calculator"; the outcome never happens.

 

I suspect I have gone wrong by replacing all the " with ' instead of using \" somewhere along the way.

The code I am trying to get working is:

 

<?php

echo  " <form name='calcform'>
  <label>
  <input name='box1' type='text' id='num' value='4'>
  </label>
  <label>
  <input type='radio' name='radio' id='radio' onClick='calculator('qualifier', 'result');'>
  qualifer
  </label>";

?>

 

Thanks :)

 

*sigh*

 

Here:

 

<?php

echo  " <form name=\"calcform\">
  <label>
  <input name=\"box1\" type=\"text\" id=\"num\" value=\"4\">
  </label>
  <label>
  <input type=\"radio\" name=\"radio\" id=\"radio\" onClick=\"calculator(\"qualifier\", \"result\");\">
  qualifer
  </label>";

?>

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.