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
https://forums.phpfreaks.com/topic/171457-html-form-using-or/
Share on other sites

Try this:

 

<?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
https://forums.phpfreaks.com/topic/171457-html-form-using-or/#findComment-904175
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
https://forums.phpfreaks.com/topic/171457-html-form-using-or/#findComment-904195
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
https://forums.phpfreaks.com/topic/171457-html-form-using-or/#findComment-904227
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.