PDA

View Full Version : 2 Questions


BobDoleX
08-04-2003, 11:45 PM
I have 2 quetsions concerning javascript.

For the first one, i have a button...


<input type="button" name="boldButton" value="Bold" Onclick="insertTag('whatever')">


in whatever, iwant to include something that would involve double quotes ( " ) like Onclick="insertTag('Hi "y" a')". in PHP, i guess u would do the \" thing, but what would u do in this case?

For the second one, i got this script...

<script>
function preview() {
document.forms[0].action = "something.php";
document.forms[0].submit();
}

function writefile() {
document.forms[0].action = "writefile.php";
document.forms[0].submit();
}
</script>

<input type="button" onClick="writefile()" value=" Submit ">&nbsp;&nbsp;
<input type="button" onClick="preview()" value=" Preview ">


I want, when i click the preview button for something.php to pop-up. How would i do this?

As you can see, i'm not very familier with javascript and only recently got into it, but help would be much appresiated
:thumbsup:

glenngv
08-05-2003, 02:01 AM
<input type="button" name="boldButton" value="Bold" Onclick="insertTag('Hi &amp;quot;y&amp;quot; a')">

function preview() {
document.forms[0].target = "_blank";
document.forms[0].action = "something.php";
document.forms[0].submit();
}

function writefile() {
document.forms[0].target = "_self";
document.forms[0].action = "writefile.php";
document.forms[0].submit();
}

BobDoleX
08-05-2003, 02:57 AM
o awesome, thank you for the help :thumbsup: