Jump to content

)(Gravitek

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

)(Gravitek's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for the reply. I must be doing something wrong still however, because I get syntax error on line 3... function valIssue() { var formObj=document.deletetable; var x=formObj.del[].length; for (var y = -1; y <= x; y++) { if (formObj.del[y].checked = TRUE) { var submit = "1"; } } if (submit == "1") { formObj.submit; } else { alert("Please select part(s) to delete!"); } }
  2. Hi there, I'm wanting to use a javascript form validation that alerts the user if none of the available checkboxes have been checked. I've done some surfing to try to find a solution, but I think the recommendations aren't working becuase of the way I've created the checkboxes... the following is the line of PHP code i use to display the checkbox in a table. The table is created from a loop because it obtains the information from a MySQL database (hence the use of echo): echo '\t<TD><CENTER><INPUT TYPE="CHECKBOX" NAME="del[]" VALUE=".$row['id']."></TD>\n'; After submission of the form, PHP deletes the record out of the MySQL database, using $row['id'] as the identifier, which is why i've used del[] as the NAME of the input type: if ($_POST['delete']) { $del = $_POST['del']; foreach ($del as $array) { $delsql = "DELETE FROM spares WHERE id='$array';"; mysql_query($delsql); echo "Record number ".$array." deleted!<BR>"; } } ---- from here on is where I am stuck ---- The idea I had to validate the form was to use a function. The function would be called when the submit button is pressed like this (the table NAME is deletetable): <INPUT TYPE="button" NAME="delete" onclick="validateCheckboxes()"> The function looks like this (which isnt working) function validateCheckboxes() { var formObj = document.deletetable; if (formObj.del.length == "0") { alert("Please select the records you wish to delete and try again!"); return false; } else { formObj.submit; } } Any help would be greatly appreciated!!!!!
  3. [quote author=bibby link=topic=123456.msg510324#msg510324 date=1169445270] If the other site has register globals on (allowing you to fake $_POSTs as $_GETs), by all means pass variables through query strings for remote logins or the like. That's how most phpBB sites get porno ads. :P I've been considering a javascript approach to something that I have to do this week on a system that I do not control. The plan (plan D, if you're wondering) is to include('http://remoteServer.com/file.html')  , and have php generated javascript fill in the form after it loads. The scenario is that they use a webform to enter data that they already know on the local system. So if I can't get the other company to play nice with me in database exchanges, then I'll write a robot to fill in their forms as they're accustomed to.  bastards. [/quote] This sounds like it's exactly what I need - you're dealing with the 'already-processed' HTML... Surely javascript can fill in fields after the page has loaded? maybe some sort of html frames system or something?
  4. [quote author=fert link=topic=123456.msg510300#msg510300 date=1169441645] look into CURL and ajax [/quote] After researching CURL, it seems that it's only useful if you are dealing with php on the other server. The other server is using webpages that have a .nsf extension, which is likely made using Java / IBM's X10 Programming Language... It looks like the only solution that I have is to work with the page after it has been processed by the server - meaning I'm going to need some sort of javascript that will post the data in to the form fields, identified by their INPUT NAME in the source code...
  5. Hi all, sorry about the subject, this one is seemingly hard to explain. Is it possible for PHP (or even Javascript) to post variables in to a form on another website? This particular website has INPUT NAME specified in the source code. This is for two internal systems at my job, and I require this functionality to avoid having to type form data in twice. Thanks
×
×
  • 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.