Dynamic form in classic asp - asp-classic

I have created a dynamic form using vbscript. It displays fine but when I click on submit button it does not post the page back... Can anyone help me? Code I have written is:
<form method="post" action="home.asp">
<%if session("id")="" then
response.write("<div id=logindiv>Login ID: <input type=text ID=loginID name=loginID /><br/><br/>Password: <input type=password ID=password name = password/><br/><br/><a href=register.asp/>Sign Up</a> <input type=submit id=loginbtn name=loginbtn value=Login /></div>")
else
response.write("already logged in")
end if%>
</form>
The resulting html is this:
<form method="post" action="home.asp">
<div id=logindiv>Login ID: <input type=text ID=loginID name=loginID /><br/><br/>Password: <input type=password ID=password name = password/><br/><br/><a href=register.asp/>Sign Up</a> <input type=submit id=loginbtn name=loginbtn value=Login /></div>
</form>

Looks like you have an extra / in your anchor tag:
<a href=register.asp/>
Maybe unrelated, but if it's closing the element, the after "Sign Up" could be screwing up the .

Related

how to button linked to a new page

I am using CodeIgnighter framework. In my view I want to change the page when I click the button.
I set the base_url correctly.
Insert
Modify
You can also do it like this :
<form action="imports/add_user">
<input type="submit" value="Insert">
</form>
<form action="imports/modify_user">
<input type="submit" value="Modify">
</form>

Refresh page after click on button

I have a upload button but after i upload something i does not refresh the page. i thougt this would work but is doesnt:
function refreshPage(){
window.location.reload();
}
<span class="ff-b white ttu f21">UPLOAD<input type="button" onClick="refreshPage()"/>Close</span>
Do some body of you know how to fix this ?
Kind regards.
<form action="upload.php" method="post" enctype="multipart/form-data">
Select image to upload:
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" value="Upload Image" name="submit">
</form>

Form with GET action does not redirect page (relative paths?)

I am trying to follow the advice from this question, on how to make an input field act like a link.
I have setup the form, and setup the URL.
Yet, when I click the input fields, nothing happens. It does not redirect me, and there is no console errors.
Any ideas on how to make this work?
Rendered source:
<form action="/ads/edit" style="display:inline;" method="get">
<input onclick="_gaq.push(['_trackEvent', 'Frontpage_Top_SaleBtn', 'click'])" type="button" class="button_green_big" value="Sælg virksomhed" />
</form>
<form action="/ads/editbuy" style="display:inline;" method="get">
<input onclick="_gaq.push(['_trackEvent', 'Frontpage_Top_BuyBtn', 'click'])" type="button" class="button_green_big" value="Køb virksomhed" style="margin-left: 10px;" />
</form>
My ASP.NET MVC code that renders this:
<form action="#Url.Action("Edit","Ads")" style="display:inline;" method="get">
<input onclick="_gaq.push(['_trackEvent', 'Frontpage_Top_SaleBtn', 'click'])" type="button" class="button_green_big" value="Sælg virksomhed" />
</form>
<form action="#Url.Action("EditBuy","Ads")" style="display:inline;" method="get">
<input onclick="_gaq.push(['_trackEvent', 'Frontpage_Top_BuyBtn', 'click'])" type="button" class="button_green_big" value="Køb virksomhed" style="margin-left: 10px;" />
</form>
as noted in one of the answers to the question on which you are referring
<form action="http://google.com">
<input type="submit" value="Go to Google">
</form>
Set your inputs type to 'submit' instead of 'button'

input username and password and buttons

on php or html page how can i do this:
name
password
and many buttons
if user press button1 he we redirct to :
http://domain.com/login.php?button1=123&name=test&password=111
buttom2:
http://domain.com/login.php?button2=456&name=test&password=111
buttom3:
http://domain.com/login.php?button3=789&name=test&password=111
Thank you
You have this simple option according to me.
<form action='login.php' method='get'>
<input type='text' name='name'>
<input type='password' name='password'>
<input type='submit' name='button1' value='123'>
<input type='submit' name='button2' value='456'>
<input type='submit' name='button2' value='789'>
</form>
Hope it helps

Form Variable Becomes Part of Link to Web Page

We are hosting a PURL site and the variable is at the end: http://mywebpage.com/first.last
Now the client wants a static web page where you go and enter a first and last, then on submit it goes to out PURL site.
Tried this with straight html but it's not going to work. On to ASP.
New to ASP and I'm trying to have a form that has 2 fields, first, last in a link. Here is the form concept:
<form id="form1" name="form1" method="post">
<p>
<label for="1">First Name:</label>
<input type="text" name="first" id="first" />
<label for="2">Last Name:</label>
<input type="text" name="last" id="last" />
</p>
<p><input type="submit" name="3" id="3" onclick="window.open('http://mywebpage.com/first=val1&.&last=val2')"/>
</p>
</form>
Any help to put me on the right tracks would be extremely welcome at this point.
Thank you,
Ed
Try this:
<form id="form1" name="form1" method="GET" action="http://mywebpage.com/" >
Then do a normal submit without onclick and window.open.
action will submit form to that URL, and method="GET" will pass form parameters in a query string.

Resources