i have a div that is a pop-up, and it is in a loop. I want to add a form to the below code so i can send the data in the textarea to the next page. Because it is a pop-up, the style changes from display:none to display:block, but when i add the form code to below it loops and ignores the style attributes, so now 30 submit buttons are appearing.


Is there another way to send data between pages rather than form? if not how can change the below code to respect the pop up code.

<div id='$counter1' style='display:none;' >

<textarea style='height:50%;width:90%;'></textarea>

<input type='submit' name='webpage' value='Add Webpage' onClick='location.href=\"http://www.example.com/stacker.php?topic=$search&amp;pos=$counter\"' />

<input type='submit' name='thread' value='Add Thread' onClick='location.href=\"http://www.example.com/post.php?topic=$search&amp;pos=$counter\"' />

<input type='submit' name='image' value='Add Image' onClick='location.href=\"http://www.example.com/image.php?topic=$search&amp;pos=$counter\"' />


</div>
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}



function ShowContent(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);

dd.style.display = "block";
}

i have a div that is a pop-up, and it is in a loop. I want to add a form to the below code so i can send the data in the textarea to the next page. Because it is a pop-up, the style changes from display:none to display:block, but when i add the form code to below it loops and ignores the style attributes, so now 30 submit buttons are appearing.


Is there another way to send data between pages rather than form? if not how can change the below code to respect the pop up code.

<div id='$counter1' style='display:none;' >

<textarea style='height:50%;width:90%;'></textarea>

<input type='submit' name='webpage' value='Add Webpage' onClick='location.href=\"http://www.example.com/stacker.php?topic=$search&amp;pos=$counter\"' />

<input type='submit' name='thread' value='Add Thread' onClick='location.href=\"http://www.example.com/post.php?topic=$search&amp;pos=$counter\"' />

<input type='submit' name='image' value='Add Image' onClick='location.href=\"http://www.example.com/image.php?topic=$search&amp;pos=$counter\"' />


</div>
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}



function ShowContent(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);

dd.style.display = "block";
}

in short, how do i make a pop up form?

what i've done is a pop up div and i'm adding a form to it, which isn't working.

Member Avatar for rajarajan2017

You have to use Light box for popups (or) open a new window using javascript. "Lightbox" looks better than "window" where you can apply your styles adding buttons and componenets into a html and load that in lightbox. To know more about lightbox. Give the keyword "Lightbox" in google, and you can get many samples of that. Go ahead with the sample and know how to create the one.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.