Jump to content

Search the Community

Showing results for tags 'edit'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Found 5 results

  1. funbinod

    edit a record

    (feeling a bit difficult to describe) i am trying to edit a post on a mysql table. in it data is transferred from one row to previous data was recorded for "ID-1" and now data on some cell should be transferred to "ID-2" and that makes change to another table also. i succeeded to change data on another table and change on "ID-2". but i got difficulties to retrieve "ID-1" to change its value. the edit form is like this --- <form method ="POST" action="saleseditpost.php"><fieldset><legend><h1>Edit Sales Record</h1></legend><div class="form-field"><label>Customer Name:</label><select name="cname" id="cname"><option></option> <?php // select table $query = "SELECT * FROM customer"; $result = mysql_query($query); if (!$result) die("Unable to select database: " . mysqli_error()); // fetch data $rows = mysql_num_rows($result); for ($n = 0 ; $n < $rows ; ++$n) { echo "<option>" . mysql_result($result,$n,'cname') . "</option>" ; } ?></select> </div> <div class="form-field"> <label>S.N.: </label> <input type="text" name="sn" id="sn" value="<?php echo $rs-> sn ?>" readonly="readonly"> </div> <div class="form-field"> <label for="date">Date: </label> <input type="text" name="date" id="date" value="<?php echo $rs-> date ?>"> </div> <div class="form-field"> <label for="ref">Ref.No.: </label> <input type="text" name="ref" id="ref" value="<?php echo $rs-> ref ?>"> </div> <div class="form-field"> <label for="amt">Bill Amount: </label> <input type="text" name="amt" id="amt" value="<?php echo $rs-> amt ?>"> </div> <div class="form-field"> <input type="submit" value="EDIT" name="submit" id="submit"> </div></fieldset></form> the name selected from the <select> option is "ID-2". data retrieved through "$rs->" is for "ID-1". now when the edit form is submitted input name - "amt" is stored for "ID-2" and previous data "$rs-> amt" must be erased from "ID-1". i succeeded to store input "amt" to ID-2 but not succeeded to erase that from ID-1. actually i could not retrieve ID-1 i want to learn how to grab that previous ID? i used action script like this --- // grab cid from cname$resultcid = mysql_query("SELECT cid FROM customer WHERE cname = '$cname'");$rowcid = mysql_fetch_array($resultcid);$cid = $rowcid['cid'];// grab balance from customer$chkBal = "SELECT * FROM customer WHERE cname = '$cname'";$result = mysql_query($chkBal) or die(mysql_error());while($myRows = mysql_fetch_array($result)) {$balance = $myRows['bal'];$newBalance = $balance + $amt;$preSales = $myRows['sales'];$newSales = $preSales + $amt;}// grab s.n.$sn = ($_POST['sn']);$sql = "SELECT * FROM customer where cid = '$cid' ";$result = mysql_query($sql);$rs = mysql_fetch_object($result);$date = strtoupper($_POST['date']);$ref = strtoupper($_POST['ref']);$amt = strtoupper($_POST['amt']);$sql2= "UPDATE sales SET sn = '$sn',cid = '$cid',date = '$date',ref = '$ref',amt = '$amt' WHERE sn ='$sn'";$sql3= "UPDATE customer SET sales = '$newSales',bal = '$newBalance' WHERE cid ='$cid'";mysql_query($sql2)or die(mysql_error()); mysql_query($sql3)or die(mysql_error());
  2. Hi guys!I've searched the net for a bit now and i tried to search the forum here but to no luck, anyway i was just wondering if you were able to help me out with an audio tag.I want to add an audio tag, which is easy enough but i want it to... automatically play and loop, but... i only want the buttons to be mute and unmute or play and unplay, i don't mind if there is two buttons but it would be cool if it was one i have found 1 or 2 examples where they turn it into text buttons (but the HTML doesn't work for it) but i was wondering if you were also able to edit it so it was an image? Thanks
  3. hey eryone I want do edit a menu select , ex: a menu selct Date , how to display data from db in the menu select it , Can help me Thask befpre
  4. I want to edit xml from asp and xslt like the demo from w3schools. I am running into some snags.What I am trying to do is create a job list that has an approval function. I already have the form uploading to the xml document that allows users to submit their jobs. I am using xslt to be able to change the status of them from pending to approve. so the new xslt file will display for users all of the approved jobs.Here is my xml file <?xml version="1.0" encoding="utf-8"?><blast><job status='approve'> <position>developer</position> <posted>01/19/2012</posted> <company>JCC</company> <city>Jackson</city> <state>MI</state> <process>webaddress.com</process> <contact>da boss</contact></job><job status='pending'> <position>lunch lady</position> <posted>01/19/2012</posted> <company>high school</company> <city>lansing</city> <state>MI</state> <process>website.com</process> <contact>da boss lady</contact></job></blast> Here is my xslt file that displays the pending jobs for approval <?xml version="1.0" encoding="utf-8"?><xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/"> <html> <head> </head> <body> <form method="post" action="editBlast.asp"> <h2>Job Approval</h2> <table cellpadding="5" cellspacing="0" border="1"> <tr> <th>Status</th> <th>Approval Action</th> <th>Position</th> <th>Company</th> <th>City</th> <th>State</th> <th>Contact</th> <th>Posted</th> </tr> <xsl:for-each select="blast/job[@status='pending']"> <tr> <td><xsl:value-of select="@status"/></td> <td> <input type="textbox" id="status" name="status" > <xsl:attribute name="value"> <xsl:value-of select="@status"/> </xsl:attribute> </input> Approve </td> <td><xsl:value-of select="position"/></td> <td><xsl:value-of select="company"/></td> <td><xsl:value-of select="city"/></td> <td><xsl:value-of select="state"/></td> <td><xsl:value-of select="contact"/></td> <td><xsl:value-of select="posted"/></td> </tr> </xsl:for-each> </table> <p><input type="submit" id="submit" name="submit" value="Submit"/> <input type="reset" id="reset" name="reset" value="Reset"/></p> </form> </body> </html></xsl:template></xsl:stylesheet> Here is my asp file: <%'-----------------------------------------------------------'The "loadXMLFile" Function accepts two parameters.'strXMLFile - The path and file name of the XML file.'strXSLFilee - The path and file name of the XSL file.'-----------------------------------------------------------Function loadXMLFile(strXMLFile, strXSLFile)'Declare local variablesDim objXMLDim objXSL 'Instantiate the XMLDOM Object that will hold the XML file.set objXML = Server.CreateObject("Microsoft.XMLDOM")'Turn off asyncronous file loading.objXML.async = false'Load the XML file.objXML.load(strXMLFile) 'Instantiate the XMLDOM Object that will hold the XSL file.set objXSL = Server.CreateObject("Microsoft.XMLDOM")'Turn off asyncronous file loading.objXSL.async = false'Load the XSL file.objXSL.load(strXSLFile) 'Use the "transformNode" method of the XMLDOM to apply the'XSL stylesheet to the XML document. Then the output is'written to the client.Response.Write(objXML.transformNode(objXSL))End Function '-----------------------------------------------------------'The "updateXML" Function accepts one parameter.'strXMLFile - The path and file name of the XML file.'-----------------------------------------------------------Function updateXML(strXMLFile)'Declare local variables.Dim objDomDim objRootDim objFieldDim x 'Instantiate the XMLDOM Object.set objDOM = Server.CreateObject("Microsoft.XMLDOM")'Turn off asyncronous file loading.objDOM.async = false'Load the XML file.objDOM.load strXMLFile 'Set the objRoot variable equal to the root element of the'XML file by calling the documentElement method of the'objDOM (XMLDOM) object.Set objRoot = objDom.documentElement 'Iterate through the Form Collection and write the'submitted values to the XML file.For x = 1 to Request.Form.Count 'Check see if "btn" is in the submitted value, if so, 'it is a button and should be ignored. If instr(1,Request.Form.Key(x),"btn") = 0 Then 'Set objField variable equal to a field_value element by 'calling the selectSingleNode method of the objRoot '(documentElement) object. The SelectSingleNode method 'accepts a string parameter for querying the XML document. 'In this case, the current value of the key property of 'the Form Collection is used to find the appropriate 'field_value element (more on this later). Set objField = objRoot.selectSingleNode("job[@status='" & _ Request.Form.Key(x) & "']") 'Set the text property of the objField (field_value) 'element equal to the value of the current form field. objField.Text = Request.Form(x) End IfNext 'After the XML file has been edited, is must be saved.objDom.save strXMLFile 'Release all of your object references.Set objDom = NothingSet objRoot = NothingSet objField = Nothing 'Call the loadXMLFile method, passing in the newly edited'XML file and the updatedcontact.xsl style sheet. This will'allow the client to see the edited information. More on the'updatedcontact.xsl file later.loadXMLFile strXMLFile,server.MapPath("blast_approved.xsl")End Function 'Test to see if the form has been submitted. If it has,'update the XML file. If not, transform the XML file for'editing.If Request.Form("btnSubmit") = "" Then loadXMLFile server.MapPath("../../forms-results/xml/text.xml"), _ server.MapPath("blast_pending.xsl")Else updateXML server.MapPath("../../forms-results/xml/text.xml")End If%> and finally my xslt file to display the approved jobs <?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/"> <html> <body><h2>Job Blast</h2> <table cellpadding="5" cellspacing="0" border="1"> <thead> <tr> <th>Position(s)</th> <th>Company</th> <th>City</th> <th>State</th> <th>Contact Information</th> <th>Posted</th> </tr> </thead> <tbody> <xsl:for-each select="blast/job[@status='approve']"> <xsl:sort select="posted" order="descending"/> <tr> <td><xsl:value-of select="position"/></td> <td><xsl:value-of select="company"/></td> <td><xsl:value-of select="city"/></td> <td><xsl:value-of select="state"/></td> <td><xsl:value-of select="contact"/></td> <td><xsl:value-of select="posted"/></td> </tr> </xsl:for-each> </tbody> </table> </body> </html></xsl:template></xsl:stylesheet> Thanks for your help!
  5. The idea:The idea is to automatically fill the fields with "user@mail.com" and "password" if they're left blank. The problem:Well, the Javascript check is working and doing what it is supposed to. However, if the user adds a value, and then erases that value leaving the input empty, the script doesn't detects the field as empty... although the value returned is indeed empty like "". The code: function loginFormToggleFillers(element){ var loginF = document.loginForm.login; var user = loginF.value; var passwordF = document.loginForm.password; var password = passwordF.value; if(element){ el = element.attributes["name"].value; if( el == "login" ){ if ( user == "" || user.length == 0 ){ loginF.setAttribute("value", "user@mail.com"); } if ( user == "user@mail.com" ){ loginF.setAttribute("value", ""); } } else if ( el == "password" ){ if ( password == "" || password.length == 0 ){ passwordF.setAttribute("value", "password"); } if ( password == "password" ){ passwordF.setAttribute("value", ""); } } } else { if ( user == "" || user.length == 0){ loginF.setAttribute("value","user@mail.com"); } if ( password == "" || password.length == 0){ passwordF.setAttribute("value","password"); } }}loginFormToggleFillers(null); The HTML call (wrote by hand, so there might be a mistake somewhere... but it's just the idea): <input type="text" name="login" onFocus="loginFormToggleFillers(this)" onBlur="loginFormToggleFillers(this)" /><input type="password" name="password" onFocus="loginFormToggleFillers(this)" onBlur="loginFormToggleFillers(this)"/> Any ideas on this? Thanks in advance!
  • Create New...