Results 1 to 10 of 10
  1. #1

    Default html-php button prob


    i made a customized button in my html page "para nindot tan.awon" then when i learned php i now need to turn my link button to a submit one.. unsaon??.. tnx..

    i tried this

    "<div id = "position">
    <p class="button"><a href="#null"></a><input type = "submit"></p>
    </div>"

  2. #2
    try daw ni:

    you can remove the <a> tag, and add onClick="this.form.submit();" on <p>

  3. #3
    cge2.. but is there a way an ma retain ang <a> kay ako xa g gamit for a certain html effect

  4. #4
    would it be much more simplier if you could do it this way?

    <input type='button' class='myclass' onclick="this.form.submit();" />

    or probably this:

    <a href="#" onlclick="this.form.submit();"><span class="my-button-class">My Special button</span></a>

  5. #5
    @psyche54

    <a href="javascript:this.form.submit();"><span class="my-button-class">My Special button</span></a>

    ako lang gi modify... dont forget the time when onclick is not yet used.... old-school kay ni siya nga implementation... this works similar to onclick event...

    Quote Originally Posted by rebbieboi View Post
    cge2.. but is there a way an ma retain ang <a> kay ako xa g gamit for a certain html effect
    there you go!!

  6. #6
    Quote Originally Posted by salbahis View Post
    @psyche54

    <a href="javascript:this.form.submit();"><span class="my-button-class">My Special button</span></a>

    ako lang gi modify... dont forget the time when onclick is not yet used.... old-school kay ni siya nga implementation... this works similar to onclick event...



    there you go!!
    good point sad sir...

    But there are cases when you let JS evaluate user inputs, and you need to return "false" value to the caller/function if user inputs does not conformed with what you require, I think the sample you have given sir would return a blank page...

    But with form submission without any input evaluation and trapping, your example would do the trick...

    But anyway, both are of the same essence...
    Last edited by psyche54; 10-05-2010 at 02:59 PM.

  7. #7
    Quote Originally Posted by psyche54 View Post
    good point sad sir...

    But there are cases when you let JS evaluate user inputs, and you need to return "false" value to the caller/function if user inputs does not conformed with what you require, I think the sample you have given sir would return a blank page...

    But with form submission without any input evaluation and trapping, your example would do the trick...

    But anyway, both are of the same essence...
    if you want to validate the fields why not use onsubmit? or create a function that will cater the validation and submission...


    function validation_function(){
    if(field!=''){
    // Submit form
    document.getElementById('frm').submit();
    }else{
    // Return
    return false;
    }
    }
    <form id="frm" method="post" action"...." onsubmit="validation_function(); return false;"></form>

    the return false on onsubmit prevents the form from submitting using the default submission event trigger... so the onlly way to submit is to call the submit() function of the form...

    and btw, it will not return blank page.... it will go to the url stated on your action field on form...
    Last edited by salbahis; 10-05-2010 at 03:27 PM.

  8. #8
    hehehehe, that is what i meant sir pertaining to input validation...


    >>>
    <a href="javascript: some_functions();">Sample</a>

    function some_functions() {
    if(field!="mydesiredtext") {
    alert("error"); return false;
    } else {
    document.myform.submit();
    }
    }
    <<<

    mao diay ni ako gipasabot sir nga mo return ug blank page...

    pero it would be appropriate to use your sample in form validation...
    Last edited by psyche54; 10-05-2010 at 04:51 PM.

  9. #9
    Quote Originally Posted by psyche54 View Post
    hehehehe, that is what i meant sir pertaining to input validation...


    >>>
    <a href="javascript: some_functions();">Sample</a>

    function some_functions() {
    if(field!="mydesiredtext") {
    alert("error"); return false;
    } else {
    document.myform.submit();
    }
    }
    <<<

    mao diay ni ako gipasabot sir nga mo return ug blank page...

    pero it would be appropriate to use your sample in form validation...

    there are lot of aproach mine is usually used with jquery... but can still work without jquery...

  10. #10
    Quote Originally Posted by salbahis View Post
    there are lot of aproach mine is usually used with jquery... but can still work without jquery...
    yeah me too sir..

    form validation nako, i use SPRY, while data submission, I use JQUERY...

  11.    Advertisement

Similar Threads

 
  1. Looking For: Basic Java, HTML, PHP books....
    By p-touch in forum Books & Magazines
    Replies: 1
    Last Post: 02-09-2012, 10:34 AM
  2. Unsa na course maka learn ko og HTML, PHP, "Web languages"
    By pusang_iring in forum Campus Talk
    Replies: 0
    Last Post: 04-14-2010, 10:55 PM
  3. need help sa drop down list in html & php
    By pulchra in forum Programming
    Replies: 8
    Last Post: 10-17-2008, 10:14 PM
  4. seo: php vs html content
    By MelodyMan in forum Websites & Multimedia
    Replies: 8
    Last Post: 07-18-2008, 01:07 PM
  5. Web programming like PHP, ASP, HTML AND FLASH ANIMATIONS
    By michaxze in forum Websites & Multimedia
    Replies: 10
    Last Post: 07-30-2005, 05:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top