Jump to content

complex (for me!) javascript


jaminxz

Recommended Posts

Hi guys,

 

I have something I need to do which is quite complex for me! i've partly started typing out the code but am tearing my hair out already! i'm not sure if this is even possible so i'm gonna need some advice before i spend another 2 hours on it!

 

ok i have rows from a database being displaid on a php web-page, which are in a form

 

Code:

 

<form action="" method="post" id="Updated_Rows_Form">

 

each row has a button next to it called close.

 

Code:

 

<input type="submit" ID="<?php echo $row_query4['ID']; ?>"

        value="Close" onclick="function confirm_delete('<?php echo $row_query4['ID']; ?>')"

 

when this button is clicked, i want to run a javascript function and pass the id of the row in question to it and then do the following actions (please excuse my crude java/pesudo code, i am an ultra newbie!)

 

Code:

 

var form_id;

function confirm_delete(ID)

{

prompt("Close at how many hours?", " <?php echo $TotalHours ?> (note: i want this to be the default but EDITABLE VALUE)");

 

if(prompt){

var HourClose = inputted data

var id = ID

<!---- Send these via POST somehow, POST the form -->

}

 

}

 

any help would be greatly appreciated as I dont know where to start!

Thanks in advance,

Jaminxz.

Link to comment
https://forums.phpfreaks.com/topic/146855-complex-for-me-javascript/
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.