473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

parsing a value from a text box to a url

Expand|Select|Wrap|Line Numbers
  1. function parse(){
  2.   me=document.forms[0].regno.value;
  3.   right_window.src="result.php?registration='me'";
  4. }
  5. <html>
  6. <input type="text" name="regno" id="regno">
  7. <input type="button" name="search" id="search" />
  8. </html>
  9.  
Sep 9 '09 #1
8 2638
Dormilich
8,658 Expert Mod 8TB
JS is not PHP. variables in strings are not replaced.
Sep 9 '09 #2
like you ve most probably observed i am new to JS and more php oriented please what options do i have?
Sep 9 '09 #3
Dormilich
8,658 Expert Mod 8TB
to be blunt, read a tutorial (more in the stickies thread). like when you started with PHP, it is best to get used to the basics of the new language first.
Sep 9 '09 #4
ok i improved it but its still not working
Expand|Select|Wrap|Line Numbers
  1. function value(){
  2. reg=this.document.forms[0].regno.value;
  3. parent.document.all.m_display.location.href="studentinfo.php?registrationnumber="+reg;
  4. }
  5.  
am sorry if am not doing this the right way but i have a dead line to submit this project
Sep 10 '09 #5
acoder
16,027 Expert Mod 8TB
Don't use document.all - use document.getElementById() to refer to elements. Check whether parent is really what you're after - do you want to change the URL of the main page from a frame?
Sep 10 '09 #6
Dormilich
8,658 Expert Mod 8TB
location is a property of either document or window. to load a new page you need to call it as
Expand|Select|Wrap|Line Numbers
  1. location.href = new_URI;
Gecko browsers may let you use
Expand|Select|Wrap|Line Numbers
  1. parent.document.location.href = new_URI;
probably the best would be to pass the value to the other window and do location.href there. but as acoder mentioned, it depends on your project.
Sep 10 '09 #7
Am not changing the main window
the frame set contains 3 frames the top for designs, the left frame is for users to search for students,schools,teachers etc and depending on what they re searching for the right window displays a document i have written to get the result of their search
Sep 10 '09 #8
Dormilich
8,658 Expert Mod 8TB
that layout could also be achieved by not using frames, which probably would lift some of the trouble.
Sep 10 '09 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Prakash | last post by:
Hi all, I am trying a parse a xml document containing japanese text by constructing a DOMBuilder object. The document created after parsing is empty. If the xml document does not contain...
3
by: David Walker | last post by:
Hi, I have an XML file created by a third party in which an element with a simple content model has a text value consisting of 2 parts separated by a colon, like this ...
9
by: ankitdesai | last post by:
I would like to parse a couple of tables within an individual player's SHTML page. For example, I would like to get the "Actual Pitching Statistics" and the "Translated Pitching Statistics"...
1
by: Thomas Kowalski | last post by:
Hi, I have to parse a plain, ascii text file (on local HD). Since the file might be many millions lines long I want to improve the efficiency of my parsing process. The resulting data structure...
12
by: Klaus Alexander Seistrup | last post by:
Hi group, I am new to xgawk (and seemingly to xml also), and I've been struggling all afternoon to have xgawką parsing an XHTML file containing a hCard˛, without luck. I wonder if you guys...
2
by: hzgt9b | last post by:
I've written a simple javascript page that parses an XML file... (Actually I just modified the "Parsing an XML File" sample from http://www.w3schools.com/dom/dom_parser.asp) The page works great...
13
by: Chris Carlen | last post by:
Hi: Having completed enough serial driver code for a TMS320F2812 microcontroller to talk to a terminal, I am now trying different approaches to command interpretation. I have a very simple...
2
by: python | last post by:
I'm parsing a text file for a proprietary product that has the following 2 directives: #include <somefile> #define <name<value> Defined constants are referenced via <#name#syntax. I'm...
3
by: raghudr | last post by:
Hi all, I am parsing a .xml file.My main intention is to retrieve the name value of node "Signal":- "Name Value" which is "rag". i want to store only the <signal"name value" that is only...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.