I just hope that someone can figure out why the clear button isn't working????? Thnx, Dave [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => davaze webforumsuser@macromedia.com [ip] => "davaze" webfor [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 6 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> > > > > >
[quote] > > > > > > > > > > > > > > > >
>
> >
> >
> >
 
>
> >
> >
> >
> > > mysql_free_result($Verslag_Update); > ?> > > > I just hope that someone can figure out why the clear button isn't[/quote] working?????[quote] > > Thnx, > Dave > >[/quote] [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => SamMan [ip] => psf@psfdev.com [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 7 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> Clear Button - HTML & CSS

Clear Button - HTML & CSS

You need to create a JavaScript function that will set the value of the textfield or whatever to null, or "". It can be as simple as this... function clearText() { doent.form1.textfield.value = ""; } In your button tag, call the js function using the onClick event.... onClick="clearText()" Remember, form1 is the name of your form (can be anything) and textfield is the name of your textfield (again, can be anything). Hope this helps, Sam "davaze" <webforumsusermacromedia.com> wrote in message news:besorr$jod$1forums.macromedia.com... > Can someone tell me how to make a Button in a form to clear a specific textfield or ...

  1. #1

    Default Re: Clear Button

    You need to create a JavaScript function that will set the value of the
    textfield or whatever to null, or "". It can be as simple as this...

    function clearText() {
    doent.form1.textfield.value = "";
    }

    In your button tag, call the js function using the onClick event....
    onClick="clearText()"

    Remember, form1 is the name of your form (can be anything) and textfield is
    the name of your textfield (again, can be anything).

    Hope this helps,
    Sam

    "davaze" <webforumsusermacromedia.com> wrote in message
    news:besorr$jod$1forums.macromedia.com...
    > Can someone tell me how to make a Button in a form to clear a specific
    textfield or whatever within that form.
    > I need a button to clear formfields, not to reset a complete form.
    >
    > Thnx,
    > Dave.
    >
    >
    >

    SamMan Guest

  2. #2

    Default Re: Clear Button

    I don't know what is going wrong but my browser keeps telling me that there's an error on the page. I included the javascript function between the <Head> tag and the <script language="javascript" type="text/javascript"> and called it with the onclick="clearText()".

    I get the error: form1.textfield is no object
    from my browser.

    What is wrong??




    davaze webforumsuser@macromedia.com Guest

  3. #3

    Default Re: Clear Button

    "form1" & "textfield" should be the name of your form & textfield,
    respectively. They can be named *anything* that you want, you just have to
    make sure they are the same in *both* your HTML page & JavaScript function.

    Sam


    "davaze" <webforumsusermacromedia.com> wrote in message
    news:beulqf$nrc$1forums.macromedia.com...
    > I don't know what is going wrong but my browser keeps telling me that
    there's an error on the page. I included the javascript function between the
    <Head> tag and the <script language="javascript" type="text/javascript"> and
    called it with the onclick="clearText()".
    >
    > I get the error: form1.textfield is no object
    > from my browser.
    >
    > What is wrong??
    >
    >
    >

    SamMan Guest

  4. #4

    Default Re: Clear Button

    I really don't know what the problem is. I still get those error from my browser and i tried it on a different computer to make sure it is not a problem with my browser.

    For example i have created a simple textform, only with a clear button (no submit added). This simple code doesn't function either.

    I really can't see the problem.

    Please sombody, the code is here and why does the clear Button not work with me?????

    Code:

    <html>
    <head>
    <title>Untitled Doent</title>
    <meta http-equiv="Content-Type" content="text/html; cht=iso-8859-1">
    <script language="JavaScript" type="text/JavaScript">
    function clearText()
    doent.form1.text.value=""
    </script>

    </head>

    <body>
    <form name="form1" method="post" action="">
    <label>
    <textarea name="text" id="text" ></textarea>
    </label>
    </form>
    <p>
    <label>
    <input type="button" name="Clear" value="Clear text" onClick="clearText()">
    </label>
    </p>
    </body>
    </html>



    Thnx for the help
    Dave



    davaze webforumsuser@macromedia.com Guest

  5. #5

    Default Re: Clear Button

    Create your function like this (enclosed in brackets) and see if that
    helps...

    function clearText() {
    doent.form1.text.value=""
    }

    Sam

    "davaze" <webforumsusermacromedia.com> wrote in message
    news:bf1mpo$2ns$1forums.macromedia.com...
    > I really don't know what the problem is. I still get those error from my
    browser and i tried it on a different computer to make sure it is not a
    problem with my browser.
    >
    > For example i have created a simple textform, only with a clear button (no
    submit added). This simple code doesn't function either.
    >
    > I really can't see the problem.
    >
    > Please sombody, the code is here and why does the clear Button not work
    with me?????
    >
    > Code:
    >
    > <html>
    > <head>
    > <title>Untitled Doent</title>
    > <meta http-equiv="Content-Type" content="text/html; cht=iso-8859-1">
    > <script language="JavaScript" type="text/JavaScript">
    > function clearText()
    > doent.form1.text.value=""
    > </script>
    >
    > </head>
    >
    > <body>
    > <form name="form1" method="post" action="">
    > <label>
    > <textarea name="text" id="text" ></textarea>
    > </label>
    > </form>
    > <p>
    > <label>
    > <input type="button" name="Clear" value="Clear text"
    onClick="clearText()">
    > </label>
    > </p>
    > </body>
    > </html>
    >
    >
    >
    > Thnx for the help
    > Dave
    >
    >
    >

    SamMan Guest

  6. #6

    Default Re: Clear Button

    Hi, thnx. It worked for the code above. The clear button seems to work in this page but it still isn't functioning in my final page. Why is such a simple jave function giving me a hard time???

    Maybe someone can look at my final test page, the code is below.
    It's a page that get's the value in the 'verslag' field from my database(mysql) that can be edited and updated. I need that clear button to clear the 'verslag' textfield. It's saved as .php page.

    Here is the code:

    <?php require_once('../../../Connections/Pielhaas.php'); ?>
    <?php
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
    $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

    switch ($theType) {
    case "text":
    $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
    break;
    case "long":
    case "int":
    $theValue = ($theValue != "") ? intval($theValue) : "NULL";
    break;
    case "double":
    $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
    break;
    case "date":
    $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
    break;
    case "defined":
    $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
    break;
    }
    return $theValue;
    }

    $editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
    if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
    $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
    }

    if ((isset($HTTP_POST_VARS["MM_update"])) && ($HTTP_POST_VARS["MM_update"] == "Verslag_update")) {
    $updateSQL = sprintf("UPDATE verslagen SET Naam=%s, Onderwerp=%s, Verslag=%s WHERE ID=%s",
    GetSQLValueString($HTTP_POST_VARS['Naam'], "text"),
    GetSQLValueString($HTTP_POST_VARS['Onderwerp'], "text"),
    GetSQLValueString($HTTP_POST_VARS['Verslag'], "text"),
    GetSQLValueString($HTTP_POST_VARS['ID'], "int"));

    mysql_select_db($database_Pielhaas, $Pielhaas);
    $Result1 = mysql_query($updateSQL, $Pielhaas) or die(mysql_error());

    $updateGoTo = "verslag.php";
    if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
    $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
    $updateGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
    }
    header(sprintf("Location: %s", $updateGoTo));
    }

    $colname_Verslag_Update = "1";
    if (isset($HTTP_GET_VARS['ID'])) {
    $colname_Verslag_Update = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['ID'] : addslashes($HTTP_GET_VARS['ID']);
    }
    mysql_select_db($database_Pielhaas, $Pielhaas);
    $query_Verslag_Update = sprintf("SELECT * FROM verslagen WHERE ID = %s", $colname_Verslag_Update);
    $Verslag_Update = mysql_query($query_Verslag_Update, $Pielhaas) or die(mysql_error());
    $row_Verslag_Update = mysql_fetch_assoc($Verslag_Update);
    $totalRows_Verslag_Update = mysql_num_rows($Verslag_Update);
    ?>
    <html>
    <head>
    <title>Edit</title>
    <meta http-equiv="Content-Type" content="text/html; cht=iso-8859-1">
    <script language="JavaScript" type="text/JavaScript">
    <!--

    function MM_findObj(n, d) { //v4.01
    var p,i,x; if(!d) d=doent; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].doent; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.doent);
    if(!x && d.getElementById) x=d.getElementById(n); return x;
    }

    function MM_validateForm() { //v4.0
    var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args);
    if (val) { nm=val.name; if ((val=val.value)!="") {
    if (test.indexOf('isEmail')!=-1) { p=val.indexOf('');
    if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
    } else if (test!='R') { num = pFloat(val);
    if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
    if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
    min=test.substring(8,p); max=test.substring(p+1);
    if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('The following error(s) occurred:\n'+errors);
    doent.MM_returnValue = (errors == '');
    }

    function clearText() {
    doent.Verslag_Update.Verslag.value="";
    }

    //-->
    </script>
    </head>

    <body bgcolor="#FFFF86">
    <form action="<?php echo $editFormAction; ?>" method="POST" name="Verslag_update" id="Verslag_update" onSubmit="MM_validateForm('Naam','','R','Onderwerp ','','R');return doent.MM_returnValue">
    <table width="100%" border="1" cellspacing="1" cellpadding="1">
    <tr>
    <td width="30%">
    <div align="right">
    <label>Naam
    <input name="Naam" type="text" id="Naam" value="<?php echo $row_Verslag_Update['Naam']; ?>" size="30">
    </label>
    </div></td>
    <td rowspan="3" valign="top"><div align="center">
    <label>Verslag
    <textarea name="Verslag" cols="100" rows="40" wrap="PHYSICAL" id="Verslag"><?php echo htmlentities($row_Verslag_Update['Verslag']); ?></textarea>
    </label>
    </div></td>
    </tr>
    <tr>
    <td><div align="right">
    <label>Onderwerp
    <input name="Onderwerp" type="text" id="Onderwerp" value="<?php echo $row_Verslag_Update['Onderwerp']; ?>">
    </label>
    </div></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td>
    <div align="left">
    <label>
    <input name="ID" type="hidden" id="ID" value="<?php echo $row_Verslag_Update['ID']; ?>">
    </label>
    </div></td>
    <td><div align="center">
    <label>
    <input type="submit" name="Submit" value="Update">&nbsp;
    <input name="Clear" type="button" id="Clear" onClick="clearText()" value="Clear">
    </label>
    </div></td>
    </tr>
    </table>
    <input type="hidden" name="MM_update" value="Verslag_update">
    </form>
    </body>
    </html>
    <?php
    mysql_free_result($Verslag_Update);
    ?>


    I just hope that someone can figure out why the clear button isn't working?????

    Thnx,
    Dave



    davaze webforumsuser@macromedia.com Guest

  7. #7

    Default Re: Clear Button

    Dave,

    You need to be careful how you spell your variables....
    You named your form "Verslag_update", and in the js function, you called it
    "Verslag_Update".

    When I changed one of the names to *exactly* match the other, there were no
    errors & the textfield cleared just fine.

    May I suggest a couple of sites that are very good for JavaScript tutorials
    & examples?...
    [url]http://www.w3schools.com/[/url]
    [url]http://www.chalcedony.com/javascript/[/url]
    For js reference...
    [url]http://www.devguru.com/Technologies/ecmascript/quickref/javascript_intro.html[/url]

    Sam


    "davaze" <webforumsusermacromedia.com> wrote in message
    news:bf44gi$3an$1forums.macromedia.com...
    > Hi, thnx. It worked for the code above. The clear button seems to work in
    this page but it still isn't functioning in my final page. Why is such a
    simple jave function giving me a hard time???
    >
    > Maybe someone can look at my final test page, the code is below.
    > It's a page that get's the value in the 'verslag' field from my
    database(mysql) that can be edited and updated. I need that clear button to
    clear the 'verslag' textfield. It's saved as .php page.
    >
    > Here is the code:
    >
    > <?php require_once('../../../Connections/Pielhaas.php'); ?>
    > <?php
    > function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
    $theNotDefinedValue = "")
    > {
    > $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) :
    $theValue;
    >
    > switch ($theType) {
    > case "text":
    > $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
    > break;
    > case "long":
    > case "int":
    > $theValue = ($theValue != "") ? intval($theValue) : "NULL";
    > break;
    > case "double":
    > $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" :
    "NULL";
    > break;
    > case "date":
    > $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
    > break;
    > case "defined":
    > $theValue = ($theValue != "") ? $theDefinedValue :
    $theNotDefinedValue;
    > break;
    > }
    > return $theValue;
    > }
    >
    > $editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
    > if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
    > $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
    > }
    >
    > if ((isset($HTTP_POST_VARS["MM_update"])) && ($HTTP_POST_VARS["MM_update"]
    == "Verslag_update")) {
    > $updateSQL = sprintf("UPDATE verslagen SET Naam=%s, Onderwerp=%s,
    Verslag=%s WHERE ID=%s",
    > GetSQLValueString($HTTP_POST_VARS['Naam'], "text"),
    > GetSQLValueString($HTTP_POST_VARS['Onderwerp'],
    "text"),
    > GetSQLValueString($HTTP_POST_VARS['Verslag'],
    "text"),
    > GetSQLValueString($HTTP_POST_VARS['ID'], "int"));
    >
    > mysql_select_db($database_Pielhaas, $Pielhaas);
    > $Result1 = mysql_query($updateSQL, $Pielhaas) or die(mysql_error());
    >
    > $updateGoTo = "verslag.php";
    > if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
    > $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
    > $updateGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
    > }
    > header(sprintf("Location: %s", $updateGoTo));
    > }
    >
    > $colname_Verslag_Update = "1";
    > if (isset($HTTP_GET_VARS['ID'])) {
    > $colname_Verslag_Update = (get_magic_quotes_gpc()) ?
    $HTTP_GET_VARS['ID'] : addslashes($HTTP_GET_VARS['ID']);
    > }
    > mysql_select_db($database_Pielhaas, $Pielhaas);
    > $query_Verslag_Update = sprintf("SELECT * FROM verslagen WHERE ID = %s",
    $colname_Verslag_Update);
    > $Verslag_Update = mysql_query($query_Verslag_Update, $Pielhaas) or
    die(mysql_error());
    > $row_Verslag_Update = mysql_fetch_assoc($Verslag_Update);
    > $totalRows_Verslag_Update = mysql_num_rows($Verslag_Update);
    > ?>
    > <html>
    > <head>
    > <title>Edit</title>
    > <meta http-equiv="Content-Type" content="text/html; cht=iso-8859-1">
    > <script language="JavaScript" type="text/JavaScript">
    > <!--
    >
    > function MM_findObj(n, d) { //v4.01
    > var p,i,x; if(!d) d=doent;
    if((p=n.indexOf("?"))>0&&parent.frames.length) {
    > d=parent.frames[n.substring(p+1)].doent; n=n.substring(0,p);}
    > if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
    x=d.forms[n];
    > for(i=0;!x&&d.layers&&i<d.layers.length;i++)
    x=MM_findObj(n,d.layers.doent);
    > if(!x && d.getElementById) x=d.getElementById(n); return x;
    > }
    >
    > function MM_validateForm() { //v4.0
    > var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;
    > for (i=0; i<(args.length-2); i+=3) { test=args[i+2];
    val=MM_findObj(args);
    > if (val) { nm=val.name; if ((val=val.value)!="") {
    > if (test.indexOf('isEmail')!=-1) { p=val.indexOf('');
    > if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an
    e-mail address.\n';
    > } else if (test!='R') { num = pFloat(val);
    > if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
    > if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
    > min=test.substring(8,p); max=test.substring(p+1);
    > if (num<min || max<num) errors+='- '+nm+' must contain a number
    between '+min+' and '+max+'.\n';
    > } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is
    required.\n'; }
    > } if (errors) alert('The following error(s) occurred:\n'+errors);
    > doent.MM_returnValue = (errors == '');
    > }
    >
    > function clearText() {
    > doent.Verslag_Update.Verslag.value="";
    > }
    >
    > //-->
    > </script>
    > </head>
    >
    > <body bgcolor="#FFFF86">
    > <form action="<?php echo $editFormAction; ?>" method="POST"
    name="Verslag_update" id="Verslag_update"
    onSubmit="MM_validateForm('Naam','','R','Onderwerp ','','R');return
    doent.MM_returnValue">
    > <table width="100%" border="1" cellspacing="1" cellpadding="1">
    > <tr>
    > <td width="30%">
    > <div align="right">
    > <label>Naam
    > <input name="Naam" type="text" id="Naam" value="<?php echo
    $row_Verslag_Update['Naam']; ?>" size="30">
    > </label>
    > </div></td>
    > <td rowspan="3" valign="top"><div align="center">
    > <label>Verslag
    > <textarea name="Verslag" cols="100" rows="40" wrap="PHYSICAL"
    id="Verslag"><?php echo htmlentities($row_Verslag_Update['Verslag']);
    ?></textarea>
    > </label>
    > </div></td>
    > </tr>
    > <tr>
    > <td><div align="right">
    > <label>Onderwerp
    > <input name="Onderwerp" type="text" id="Onderwerp" value="<?php
    echo $row_Verslag_Update['Onderwerp']; ?>">
    > </label>
    > </div></td>
    > </tr>
    > <tr>
    > <td>&nbsp;</td>
    > </tr>
    > <tr>
    > <td>
    > <div align="left">
    > <label>
    > <input name="ID" type="hidden" id="ID" value="<?php echo
    $row_Verslag_Update['ID']; ?>">
    > </label>
    > </div></td>
    > <td><div align="center">
    > <label>
    > <input type="submit" name="Submit" value="Update">&nbsp;
    > <input name="Clear" type="button" id="Clear" onClick="clearText()"
    value="Clear">
    > </label>
    > </div></td>
    > </tr>
    > </table>
    > <input type="hidden" name="MM_update" value="Verslag_update">
    > </form>
    > </body>
    > </html>
    > <?php
    > mysql_free_result($Verslag_Update);
    > ?>
    >
    >
    > I just hope that someone can figure out why the clear button isn't
    working?????
    >
    > Thnx,
    > Dave
    >
    >

    SamMan Guest

  8. #8

    Default Re: Clear Button

    Thnx a lot. I must have mistyped but it finally works now.
    Sometimes you can look at the code over and over again and you just don't see it.

    Anyway thanks a lot and the sites you recommended are very helpfull.

    Dave.



    davaze webforumsuser@macromedia.com Guest

  9. #9

    Default Clear button

    I want to have a javascript tfunction to work just like the reset button, is
    anyone knows?

    In the other word, I want to have a button and when I click on that button to
    clear out the form but not use the reset type

    thanks

    newcf Guest

  10. #10

    Default Re: Clear button

    NewCF,

    Try the attached code.

    Swift



    <script>
    function clearall(f){
    for(var i = 0; i < f.length; i++){
    f[i].value = "";
    }
    }
    </script>

    <input type="button" name="btnclearall" value="Clear All"
    onclick="clearall(this.form);">

    Swift Guest

Similar Threads

  1. Replies: 1
    Last Post: November 16th, 07:21 PM
  2. Behaviour 4 a 'clear' button
    By j1mmy webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 1
    Last Post: November 7th, 01:14 PM
  3. Creating behaviours 4 a 'sumbit' & 'clear' button!
    By j1mmy webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 0
    Last Post: November 6th, 07:02 AM
  4. Replies: 1
    Last Post: July 20th, 05:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •