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