input field question

Discussion in 'HTML' started by thomanjl, Aug 4, 2006.

  1. thomanjl

    thomanjl Guest

    This is my input field code:

    <input name="subButton" type="button" value="Cancel"
    onclick="javascript: Response.Redirect URL_HOME />

    My problem is the button doesn't redirect to the destined url...any
    ideas??

    thanks

    jeremiah thoman
     
    thomanjl, Aug 4, 2006
    #1
    1. Advertising

  2. thomanjl wrote:
    > This is my input field code:
    >
    > <input name="subButton" type="button" value="Cancel"
    > onclick="javascript: Response.Redirect URL_HOME />
    >
    > My problem is the button doesn't redirect to the destined url...any
    > ideas??
    >


    Firstly, what would happen if client has JavaScript disabled, eh?.
    Secondly that is not how you do a JavaScript redirect. Thirdly you
    should not do this with JavaScript but with server-side scripting.

    Not familiar with ASP but in pseudo code, your cancle button should be a
    submit button


    <form action="receiving.script" method="post">
    ....
    <input type="submit" name="cancel" value="Cancel">

    then "receiving.script"

    if in POST var cancel exists then
    {
    redirect header to URL_HOME
    }
    else
    {
    process form posted data
    }



    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Aug 4, 2006
    #2
    1. Advertising

  3. thomanjl

    spiffy Guest

    I could be wrong, but I don't think you are supposed to include the
    "javascript:" part

    I think it should be:

    <input name="subButton" type="button" value="Cancel"
    onClick="Response.redirect URL_HOME" />

    OR

    <input name="subButton" type="button" value="Cancel"
    onClick="Response.redirect URL_HOME" />

    maybe?


    thomanjl wrote:
    > This is my input field code:
    >
    > <input name="subButton" type="button" value="Cancel"
    > onclick="javascript: Response.Redirect URL_HOME />
    >
    > My problem is the button doesn't redirect to the destined url...any
    > ideas??
    >
    > thanks
    >
    > jeremiah thoman
     
    spiffy, Aug 4, 2006
    #3
  4. thomanjl

    spiffy Guest

    Jonathan is right...

    that's how I would do it, in the ASP or Ruby code


    thomanjl wrote:
    > This is my input field code:
    >
    > <input name="subButton" type="button" value="Cancel"
    > onclick="javascript: Response.Redirect URL_HOME />
    >
    > My problem is the button doesn't redirect to the destined url...any
    > ideas??
    >
    > thanks
    >
    > jeremiah thoman
     
    spiffy, Aug 4, 2006
    #4
  5. thomanjl

    spiffy Guest

    you can also call a redirect using:

    location.href='index.htm'

    so
    <input name="subButton" type="button" value="Cancel"
    > onclick="location.href='URL_HOME'" /> should work too


    but remember, URL_HOME has to be defined


    thomanjl wrote:
    > This is my input field code:
    >
    > <input name="subButton" type="button" value="Cancel"
    > onclick="javascript: Response.Redirect URL_HOME />
    >
    > My problem is the button doesn't redirect to the destined url...any
    > ideas??
    >
    > thanks
    >
    > jeremiah thoman
     
    spiffy, Aug 4, 2006
    #5
  6. thomanjl

    spiffy Guest

    you can also call a redirect using:

    location.href='index.htm'

    so
    <input name="subButton" type="button" value="Cancel"
    > onclick="location.href='URL_HOME'" /> should work too


    but remember, URL_HOME has to be defined

    (sorry for the multiple posts)

    thomanjl wrote:
    > This is my input field code:
    >
    > <input name="subButton" type="button" value="Cancel"
    > onclick="javascript: Response.Redirect URL_HOME />
    >
    > My problem is the button doesn't redirect to the destined url...any
    > ideas??
    >
    > thanks
    >
    > jeremiah thoman
     
    spiffy, Aug 4, 2006
    #6
  7. thomanjl

    chennakesava reddy

    Joined:
    Feb 20, 2010
    Messages:
    2
    to know about how to create buttons in html

    dear sir,

    i am chennakesava reddy.,

    my problem is that when we click a button some of the subbuttons must be display from that button.

    would you tell me any answer for my problem.

    :help: :help:
     
    chennakesava reddy, Feb 21, 2010
    #7
  8. thomanjl

    chennakesava reddy

    Joined:
    Feb 20, 2010
    Messages:
    2
    to create subbuttons from a button.

    dear sir,

    i am chennakesava reddy.,

    my problem is that when i click a button some of the subbuttons must be display from that button.

    would you tell me any answer for my problem.

    :help: :help:
     
    chennakesava reddy, Feb 21, 2010
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. J Sahoo
    Replies:
    3
    Views:
    5,311
    naikpalak
    Apr 30, 2009
  2. Indu
    Replies:
    0
    Views:
    167
  3. Sound
    Replies:
    2
    Views:
    465
    Randy Webb
    Sep 28, 2006
  4. jr
    Replies:
    3
    Views:
    450
  5. JRough

    event question for a time input field

    JRough, Feb 2, 2012, in forum: Javascript
    Replies:
    2
    Views:
    619
    Dr J R Stockton
    Feb 3, 2012
Loading...

Share This Page