HTML - Catch User Input And Assign To Javascript Variable
This seems like an easy question, but what's the correct way to get user input and submit to a function?
I'm able to get it to work like the following, but it doesn't seem like the 'right' way to do things: Code: <form name="some_name" action="doesnt-exist.php" onSubmit="return some_function()"><input type="text" name="query" /></form> And then I catch the variable in some_function() and return false so the page doesn't try to contact doesnt-exist.php. Then I'm able to use the input for my function. Like I said, this works, but is there a cleaner, more standard way? Thank you! Similar TutorialsThis might have already been answered but I need html code for this. "User input field" redirects to www.website.com/"user input".aspx Simple I think but I am going crazy trying to get it to work. I would like it to open to the page not a frame. Thanks Pete Hello.... I have a problem today and I do not know how to over come this problem. If this is in the wrong place, please tell me and I will put it in the right place. Anyway. Today I am trying to make a webpage, where the user, the admin, is able to edit the page to input text. Almost like when you make a blog post and you have a text box and you type what you want and you click submit or post and it goes onto a page. Almost like wordpress. I want to make a custom page from the ground up where there are different divisions of the page and the admin can input or edit text/pictures at anytime. Thank you in advance. I am struggling to modify the code below, I am trying to take the input of a test box and us it as a filter for my list,, <FieldRef Name="ID"/> </OrderBy> <Where> <Contains> <FieldRef Name="Cust_x0020_Part_x0020_No"/> <Value Type="Note">xxxxxxxx</Value> </Contains> </Where> </Query></View></ListViewXml> I need to make xxxxxxxx a variable string any help will be much appreciated Okay so I want to make an input where a user (me) can input coding and then it will post it in another place but it will display in the site as not coding but just will execute the code....how would I go about doing this? Thanks for any help! (I'm trying to make a simple blog for my site but don't want to have to recode the entire page for each post individually. I would love to be able to just enter in one post's coding then it will display...I just assumed it's possible? Because of HTML code previewers out there.) Dear expert (Ok, i am new to this and should maybe not address this as a letter ) I hope someone can help me ... this is what i want to achieve (I am using frontpage) I want to create a table (this i can do!) that require a user input (number of guests). It then has SEVERAL options: - Select an option from a drop down list, and a price is then loaded from somewhere to create a total for that option and display it in the table (And keep that total for adding later) - Check a box, and if checked it creates a further calculation, displaying and storing the number for further calculation. a number of the above options, and a grand total on the bottom. I found more or less a page on a site that does what i am looking for, but after looking at the code, i have even LESS of an idea how it works Can someone PLEASE help me, or point me in the right direction? (I am not looking for someone to just write the code for me, as this will not teach me anything, and i want to learn) Below is a link to the example .. http://www.ouma-se-kombuis.co.za/test.html Thank you! Hello all! This is my first post here and after getting little to no help from Yahoo answers I decided to go where the pros are. I want to thank everybody in advance for taking the time to read my question and offer any help. I also want to say that I am not looking for somebody to do the work for me...just point me in the right direction to get started on figuring it out myself. You know...give a man a fish....blah blah blah. Now for my question: I am building a simple HTML template for a friend to use on an auction site. My friend has absolutely no idea of how to edit HTML so to make it easier for her, I want to add forms that will allow her to input her information (item description, shipping and payment terms) and have it applied to the template in the correct place. I had already received a snippet of code from a helpful fellow that will turn anything typed into the fields into HTML for her to copy and paste. The problem with it though is that it has no format and I cannot figure how to get it to display the code inside of the template I made. I did a little tweaking of what I had to get the basic setup of the forms and such, but cannot figure out how to place the information from each textarea into the template. I have done a few hours of research trying to find the answer, but keep coming up empty handed because I have no idea where to even start looking for the answer. Can it be done with HTML or will I have to use another language? (This will be done from her computer so from my understanding php and any other server side stuff will not work.) The code I'm wanting to use (if possible) is attached as "Formcode.txt". The template I want to use it in is attached as "Template v1.3.txt". The forms do not necessarily need to be placed at those locations but the output needs to be there. Thank you all so much for taking the time to help! BTW, I know that there are tons of free WYSIWYG editors out there that she could download and use but this has bugged me to the point that I have to find the solution. This should be so simple task but no. How can I pass input field value to the function? What I read from the input field, as soon as I press the "Save results" the value of the input field should be passed within the function. All I can do is puit 'stuffhere' and it works but simply can not manage to retriveve the input data! <form name="inputData"> <input type="text" name="userName" size="32"/><br /> <a href="#" OnClick="SetText('resultHandler','Username',' stuffhere ');SendMessageToTheObject('resultHandler','saveResult');return true;"><font color="red">[Save result]</font></a> </form> I have this script: HTML Code: <script> function upload() { document.getElementById("filebox").style.visibility='visible'; document.getElementById("namebox").style.visibility='hidden'; document.getElementById("newfile").value='1'; } </script> <form method="post" enctype="multipart/form-data"> <table> <tr><td>Bestand:</td><td colspan="2"> <input type="hidden" id="newfile" name="newfile" value="0" /> <span id="filebox" style="visibility:hidden;"> <input type="file" name="uploadedfile" style="width:300px;" /> </span> <span id="namebox"> <input name="filename" type="input" style="width:300px;" value="<?php echo $row['bestand'] ?>" DISABLED="DISABLED" /> <a href="javascript:upload()">New File</a> </span> </td></tr> ...more form... </table> </form> My problem is now that the ''filebox" and "namebox" are not at the same place. I want that if a use presses 'New File' the "namebox" is hidde and ''filebox" appears at exact the same place as "namebox" was. how to do this? Why is this not working? (when i search hiscores it works, but not Google) Quote: <html> <head> <title></title> <script type="text/javascript"> function action( inStr ){ var a = "http://hiscore.runescape.com/hiscorepersonal.ws?user1="; var b = "http://www.google.com/search?q="; var c = document.sform; if( inStr == "h" ){ c.action = a; }else if( inStr == "g" ){ c.action = b; }else{ alert("I don't know where you want to go!!!"); } c.submit(); return true; } </script> </head> <body> <form method="get" action="#" target="_blank" name="sform"> <input name="user1" size="12" maxlength="12" value="" style="font-size: 10px;" type="text"> </form> <br> <input type="button" name="btnH" value="Hiscores" style="font-size: 10px;" onclick="action('h');"> <input type="button" name="btnG" value="Google" style="font-size:10px" onclick="action('g');"> </body> </html> I have an embedded flash element and calls on a URL for it's content. Code: <embed flashvars="www.url.com"........> The URL I need I have as a variable in some javascript in the header. How can I set flashvars to be the variable I need? hi i am new to this forum but wish anyone can help me as soon as possible as i am in hurry i have a value that is associated with the page http://1028634246.n126908.test.prosi...uk/Order.html? Productid='N60 - 400 Major Service Kit' i want this value to be assigned to text box to be displayed in this as default value of this textbox what is the code to achieve this? can i use jave script if so how ,what is the code is the page need to have asp extension? wish any one can reply me and help me as soon as possible thanks I want to have the user enter text, then click a "Save" button of some sort, and JavaScript save the text as a variable. I for the life of me can't figure out how. HELP!!! Hey, I'm trying to pass a variable from some HTML code to JavaScript and I'm having some trouble. For example: HTML Code: <form name ="columnList" onchange="submitForm(this);"> Column: <c:forEach var="columnitem" items="${columns}"> <c:if test="${columnitem.name != this.document.columnList.name}"> <input type="checkbox" name="selectedColumns" id="${columnitem.name}" value="${columnitem.name}">${columnitem.name} </input> <script type="text/javascript" language ="JavaScript"> var col = document.columnList.columnitem.name; setColumns(col); </script> </c:if> </c:forEach> I'm trying to get the columnitem name from the HTML portion to the script. And I know that columnitem.name works for the check boxes. Can anyone help me out? I'm trying to create a page that refreshes a frame at a random interval - I've used Javascript to come up with that random interval (minimum of 5, max of 10), but the page refreshes using a meta tag in the head. I'm obviously not getting any results - help anyone? Following is the code: Code: <html> <head> <script language="JavaScript"> var now = new Date(); var secs = now.getSeconds(); var raw_random_number = Math.random(secs); var random_number = Math.round(raw_random_number * (5)+5); <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta http-equiv="refresh" content="5"> </script> <title>New Page 1</title> </head> <FRAMESET COLS="*,1"> <FRAME SRC="http://htmlcodetutorial.com"> <FRAME> </FRAMESET> </HTML> Okay. I use a javascript that detects the browser and if it is Internet Explorer it sets IE=true;. Later I need to check wether it's true or false, but the problem is that the rest of the site is html. So my question is, how do I detect in html wether a javascript variable is true or false? I really need some help on this one. Hi all, sorry I am pretty new with this so I hope I can explain what it is I am trying to do here. I've recently been tasked with creating a 'note taking' html template at work, to assist with note taking for operators in a call center. I was selected due to nobody else having any understanding of how computers work beyond using microsoft office, go figure : / Anyway. Basically what I am trying to do is be able to create a basic htlm template which has a text box, and some 'radio' buttons and check boxes which assign text when selected. Example, we take down notes when clients call up and speak with someone. We would have say 2 check boxes to cover things like "Full name of client confirmed, confirmed clients details". If the phone operator clicked these 2 buttons, it would copy that exact text into the text box. If they clicked one, it would only copy that. There would also be a 'radio' button, "Transferred client directly to desired party, transferred client to extension without employee contact" would be the options for example. Basically only 1 option can be selected, and that option would populate the text box if selected. I'm also looking at hwo to create a button with a 'reset' feature to basically wipe everything clean so it can be started over once the operator takes another call. So far I am able to create a form with the text box and buttons, but I don't know what code I need to look at to assign text to those buttons. It's an easy idea, just need to get my foot in the door as I haven't really touched html since I was finishing high school year ago. Anyone able to assist, i would imagine it's not as difficult as I am makign it out to be Ok so here is my issue, i am new to web site design and i have a simple project i would like to work on. I am looking to have an entry box with a simple submit button, then i would like the submissions to be displayed below in the order they are submitted. I would also like to limit the number of submissions that show on the page at a given time by creating multiple pages that can be viewed. This seems like a very simple issue but im having trouble finding solutions on the web. Would inserting a java app or some other secondary tool be better? Any help is appreciated -Matt Hi What is wrong with this, it can't post text only post checkbox <html> <head> </head> <body> <FORM action="http://localhost:8182/items" method="post"> <P> <LABEL for="firstname">First name: </LABEL> <input type="text" value = "Hamada" id="firstname"><BR> <LABEL for="lastname">Last name: </LABEL> <input type="text" value = "I hate my life" id="lastname"><BR> <LABEL for="email">email: </LABEL> <input type="text" id="email" value = "I hate you"><BR> <INPUT type="radio" name="sex" value="Male"> Male<BR> <INPUT type="radio" name="sex" value="Female"> Female<BR> <input type="submit" value="Submit"> <INPUT type="reset"> </P> </FORM> </body> </html> Thanks Is there a way to assign a visual basic array to a html textbox array. Can someone tell me why the following does not work? Thanks in advance for any assistance. Public Class textboxI Inherits System.Web.UI.WebControls.TextBox End Class Sub initialize() For Me.a = 1 To 4 tb(a) = New textboxI With tb(a) .Width = Unit.Percentage(4.5) .BackColor = Drawing.Color.Yellow .Font.Size = FontUnit.XSmall End With Next End Sub |